Linux Disk Growth and Log Rotation Checklist

halfbrain_logo512adminJune 19, 2026
3 lượt xem

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

  1. Check filesystem usage.
  2. Check inode usage.
  3. Find the fastest-growing directories.
  4. Check log directory size.
  5. Check logrotate configuration.
  6. Check Docker disk usage if used.
  7. Check database storage size.
  8. Check local backup retention.
  9. Rotate or compress logs safely.
  10. 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.

Checklist Type Monitoring
Level Intermediate
Risk Level Medium Risk
Estimated Time 30–90 minutes

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

  1. Check df.
  2. Check inodes.
  3. Find large directories.
  4. Check logs.
  5. Check logrotate.
  6. Check Docker usage.
  7. Check database size.
  8. Check backup retention.
  9. Rotate safely.
  10. Add monitoring threshold.

Verification Steps

  1. Growth source is identified.
  2. Log rotation is configured.
  3. Backup retention is controlled.
  4. Disk usage drops safely.
  5. Monitoring catches future growth.

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

Share:

Disclaimer: The guides, checklists, commands, and examples on HalfBrain.net are provided for educational and operational reference only. Server environments, hosting providers, software versions, security settings, and WordPress configurations can vary, so you should always review commands before running them on your own system. We do our best to keep the content accurate and useful, but we cannot guarantee that every command, configuration, or recommendation will fit every environment. Always back up your website, database, and server configuration before making changes. HalfBrain.net is not responsible for data loss, downtime, security incidents, misconfiguration, or other issues that may result from applying the information on this website. Use the material at your own discretion.

Leave a Reply

Your email address will not be published. Required fields are marked *