Disk and Filesystem Checks
Disk issues usually show up as secondary failures: services stop writing, deploys fail, temp files break, or databases go read-only.
Core commands
Section titled “Core commands”df -h # show filesystem space in human-readable unitsdf -i # show inode usagedu -sh /var/* # estimate size of each path under /vardu -sh ./* # estimate size of each path in the current directorymount # list mounted filesystemsfind /var/log -type f -size +100M # find large log filesWhat to check first
Section titled “What to check first”Space usage:
df -hInode usage:
df -iBig directories:
du -sh /var/* | sort -hWhat matters
Section titled “What matters”- A filesystem can have free space but no free inodes.
- Log growth is a common cause of disk pressure.
- Temporary directories filling up can break installs, deploys, and service restarts.
Practical rule
Section titled “Practical rule”Check both df -h and df -i. If you only check bytes, you can miss inode exhaustion completely.
Common mistake
Section titled “Common mistake”Do not run du blindly at the root of a large filesystem unless you need to. Start in likely hot spots like /var/log, /var/lib, /tmp, and app data directories.