DF and DU Disk Usage Investigation Checklist
df and du are must-have tools for understanding disk problems. df shows filesystem usage. du shows directory usage. Together they help find full disks, growing logs, large backups, Docker storage, uploads and database growth.
Core principle
df tells you which filesystem is full. du helps you find what is using the space. Do not delete files until you understand both.
Checklist
- Check filesystem usage with df.
- Check inode usage.
- Find large top-level directories.
- Check /var growth.
- Check Nginx logs.
- Check Docker data if used.
- Check backup folders.
- Check WordPress uploads.
- Check database data size.
- Clean or rotate data safely.
Reusable lesson
Disk investigation applies to WordPress, Docker, MySQL, backups, logs, video generation, crawlers, automation pipelines and file upload systems.
When to Use This Checklist
Use this checklist when a VPS disk is full, backups fail, uploads fail, database stops, Docker grows or logs consume storage.
Required Tools
SSH access, df, du, Docker if used, website root path, backup path, database path
Before You Start
Do not delete large files before identifying what service created them and whether they are needed for recovery.
Structured Checklist Steps
- Run df -h.
- Run df -i.
- Find large directories.
- Check /var.
- Check logs.
- Check Docker.
- Check backups.
- Check uploads.
- Check database.
- Clean safely.
Verification Steps
- Full filesystem is identified.
- Large directories are known.
- Inode issue is ruled out or confirmed.
- Cleanup target is safe.
- Disk usage decreases after action.
Rollback Plan
If cleanup breaks a service, restore the deleted data from backup if available and redesign retention or log rotation instead of deleting blindly.
Common Mistakes
- Only using df and not du.
- Ignoring inodes.
- Deleting database files manually.
- Deleting Docker volumes blindly.
- Keeping backups on the same full disk.
Related Commands
df -h
df -i
sudo du -sh /* 2>/dev/null
sudo du -sh /var/* 2>/dev/null
sudo du -sh /var/log/* 2>/dev/null
docker system df
sudo du -sh /var/lib/mysql 2>/dev/null