Web Server Rescue
Read-onlyCheck Filesystem Space with df
Writes are failing and you need to prove which mounted filesystem is full before deleting or moving anything.
Command
df -h
Before you run this
System impact: Read-only. Low when scoped to the shown target.
When not to use it: Do not use it to choose a file to delete. `df` tells you the full mount; `du` or `find` tells you what is using space inside it.
Expected output
A table of filesystems showing size, used space, available space, use percentage, and mount point. The mount point is the key field for the next command.
System impact
Read-only. Nothing changes. The command reports mounted filesystem usage, not individual file or directory size.
Recovery / rollback: no state is changed.
When to use it
Use first in disk triage so cleanup stays inside the filesystem that is actually full.
When not to use it
Do not use it to choose a file to delete. `df` tells you the full mount; `du` or `find` tells you what is using space inside it.
Watch this command run
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 25G 19G 5G 80% /work
tmpfs 982M 12M 970M 2% /run
$ du -xh --max-depth=1 /var 2>/dev/null | sort -h
24M /var/tmp
180M /var/cache
1.4G /var/log
3.8G /var/lib
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
df -hdu -xh --max-depth=1 /var 2>/dev/null | sort -h
next steps
Related commands
Find Large Directories with du
Once you know a filesystem is full, the next question is where.
du -xh --max-depth=1 /var 2>/dev/null | sort -h
Find Which Folder Is Filling the Disk
The disk was full. The fastest clue was the folder, not the file.
du -sh /var/* 2>/dev/null | sort -h
Check Inodes When Disk Space Looks Fine
Sometimes the disk has free bytes but still cannot create files.
df -ih
Check Bytes and Inodes Before Cleanup
No space left can mean full bytes, full inodes, or both.
df -h /lab/disk-inode-cleanup && df -ih /lab/disk-inode-cleanup
Inspect Release Disk Usage
Disk pressure during deploys often starts in old release directories.
du -sh releases/* 2>/dev/null | sort -h | tail -10
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Useful for
- LPIC-1 style command-line practice
- LFCS style performance tasks
- Linux+ style troubleshooting review
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.