Linux Disk Growth and Log Rotation Checklist
Disk growth is one of the most common causes of server failure. Logs, backups, uploads, Docker data, database files and temporary files can silently fill a VPS until services stop writing data.
Core principle
Disk usage must be controlled by retention, rotation and monitoring. Cleanup should not be an emergency-only habit.
Checklist
- Check filesystem usage.
- Check inode usage.
- Find the fastest-growing directories.
- Check log directory size.
- Check logrotate configuration.
- Check Docker disk usage if used.
- Check database storage size.
- Check local backup retention.
- Rotate or compress logs safely.
- Add monitoring threshold for disk usage.
Reusable lesson
This applies to Nginx logs, PHP logs, MySQL logs, Docker logs, WordPress uploads, backup archives, crawlers and automation pipelines.
When to Use This Checklist
Use this checklist when a VPS disk keeps growing, logs are too large, backups fill storage or services fail because disk is full.
Required Tools
SSH access, df, du, logrotate, Docker if used, database path, backup path, monitoring tool
Before You Start
Do not delete large files before identifying their owner service and recovery value.
Structured Checklist Steps
- Check df.
- Check inodes.
- Find large directories.
- Check logs.
- Check logrotate.
- Check Docker usage.
- Check database size.
- Check backup retention.
- Rotate safely.
- Add monitoring threshold.
Verification Steps
- Growth source is identified.
- Log rotation is configured.
- Backup retention is controlled.
- Disk usage drops safely.
- Monitoring catches future growth.
Rollback Plan
If cleanup removes needed data, restore from backup and replace manual deletion with retention rules or log rotation.
Common Mistakes
- Deleting logs without understanding cause.
- Ignoring inodes.
- No log rotation.
- Keeping all backups locally forever.
- Deleting Docker volumes blindly.
Related Commands
df -h
df -i
sudo du -sh /var/* 2>/dev/null
sudo du -sh /var/log/* 2>/dev/null
ls -la /etc/logrotate.d/
sudo logrotate -d /etc/logrotate.conf
docker system df