Professional Documents
Culture Documents
FileSystem Troubleshooting
FileSystem Troubleshooting
Troubleshooting
Cannot CD Into a Directory
t r w x r w x r w x
- -u- - |- g- - | - o- -
• File Type
• Parent Directory Permissions
• Hidden Directories
• What is a link?
• Type of links
• Hard link and symbolic link
• Command and syntax (source first and then target)
• Complete paths (example: ln –s /home/iafzal/seinfeld/george /tmp/gc)
• Permissions
• Source or target file/dir missing or does not exist.
• What = df
• Actions
• Find out what is causing the issue (du)
• Free up disk space by deleting old or big files
• Compress the old files (tar -czvf archive.tar.gz file)
• Move files to another partition or another server
• Check harddisk status
• badblocks -v /dev/DISK or /dev/sda
• iostat
• Create a link to another filesystem or directory
• Add additional disk and extend using LVM
• Next lectures…
• Add Disk and Create Standard Partition
• Add Disk and Create LVM Partition
• Extend Disk with LVM.
By: Imran Afzal
How to Delete Old Files
Command Syntax
• find /path/to/files/ -type f -name '*.jpg' -mtime +30 -exec rm {} \;
Explanation
• First part is the path where your files are located.
• Second part -type is the file type f stands for files
• Third part -name is for using the actual file names
• Fourth part -mtime gets how many days the files older then will be listed. +30 is
for files older then 30 days.
• Fifth part -exec executes a command. In this case rm is the command, {} gets the
filelist and \; closes the command
• Filesystem?
• Types of filesystem
• ext3, ext4, xfs, NTFS etc.
• Filesystem Layout and partitions
• /var, /etc, /root, /home etc.
• Checking filesystem
• df, fdisk –l
• Troubleshooting Steps:
• Check /var/log/messages or /var/log/syslog
• Run fsck on the block device (/dev/sda) NOT on mount point
• Unmount filesystem and run fsck
• Troubleshooting Steps:
• Boot in rescue mode by mounting CD / CD ISO image
• Chose option 1 to mount root filesystem
• Fix the /etc/fstab file
• For deleted file = run blkid
By: Imran Afzal