What this is
This guide explains how to check disk usage on Linux with df -h and interpret the result.
What it is for
- Prevent outages caused by a full disk
- Find which filesystem is running out of space
Prerequisites
- SSH access
Step-by-step
Step 1) Run df -h
df -h
What it does: Shows disk usage for mounted filesystems in human-readable units.
Expected output: Columns like Size, Used, Avail, Use%, Mounted on.
Step 2) Focus on the root filesystem
Look for the line mounted on /.
Warning threshold: If Use% is above 85–90%, plan cleanup soon; near 100% can break services.
Step 3) Identify what is filling the disk
sudo du -xh / --max-depth=2 2>/dev/null | sort -h | tail -n 20
Expected output: Largest directories.
Warnings & notes
- Some filesystems (tmpfs) are RAM-based; they are normal.
- Cleanup should be careful: deleting logs or database files can cause issues.
Final verification
df -h
Conclusion
df -h is your first “health check” for disk space. Use it regularly to avoid downtime.