What Is Disk Usage in Linux System Administration?

halfbrain_logo512adminJune 20, 2026
1 lượt xem

Disk usage shows how much storage is being used by files, directories, logs, databases, backups, cache, and system data. For a system administrator, disk usage is a direct uptime risk.

Simple explanation

A server can have enough CPU and memory but still fail because the disk is full. When disk space reaches 100%, services may stop writing logs, databases may crash, uploads may fail, and updates may break.

Why it matters

Disk pressure is common on small VPS systems because logs, backups, cache, uploads, and databases grow silently.

Real VPS example

If WordPress suddenly cannot upload images or MySQL refuses writes, check disk usage before assuming the application is broken.

What breaks if you ignore it

Full disk can break database writes, SSL renewal, backups, sessions, plugin updates, and even SSH login behavior.

HALFBRAIN SYSTEM ADMINISTRATOR

System Administrator Operating Notes

Core principle, commands, verification, troubleshooting, rollback, and cloud/security connection.

Foundation

Skill Level

foundation

System Layer

storage

Core Principle

Disk usage measures storage pressure. A full disk can break services even when CPU, RAM, and network are healthy.

Mental Model

Think of disk as the server warehouse. If the warehouse is full, workers cannot store logs, database changes, uploads, or temporary files.

When To Use

Use this when websites fail to upload, database writes fail, logs stop, backups fail, SSL renewal fails, or the server becomes unstable.

Wrong Assumption

Beginners often delete random files. A real administrator identifies what grew, whether it is safe to remove, and how to prevent recurrence.

Commands

Primary Command

df -h; du -sh /* 2>/dev/null; du -sh /var/* 2>/dev/null; find /var/log -type f -size +100M

Command Breakdown

df shows filesystem usage. du shows directory size. find locates large files. Redirecting errors keeps output readable.

Safe Check Command

df -h; df -i; lsblk; mount | column -t

Expected Output

Disk usage should not be near 100%. Inodes should not be exhausted. Critical partitions should have enough space for logs and updates.

Verify Command

df -h; df -i; du -sh /var/log /var/www /var/lib/mysql /tmp 2>/dev/null

Troubleshooting

Common Failures

Full disk, inode exhaustion, oversized logs, old backups, cache growth, database bloat, large uploads, or abandoned temporary files.

Log Files

/var/log/syslog; /var/log/nginx/access.log; /var/log/nginx/error.log; /var/log/mysql/error.log

Debug Commands

du -ah /var | sort -h | tail -40; journalctl --disk-usage; find / -xdev -type f -size +500M 2>/dev/null

Root Cause Map

Start from filesystem fullness, identify top directories, separate logs/backups/database/uploads, then clean only known safe targets.

Fix Pattern

Clean logs through rotation or truncation, remove old backups, clear cache safely, then add monitoring and retention policy.

Risk & Recovery

Risk Level

high

Backup Before Change

Before deleting files, confirm path, file type, owner, service dependency, and whether it is backup, log, cache, or database data.

Rollback Plan

If cleanup breaks a service, restore deleted files from backup if available, fix ownership, restart affected service, and review logs.

Blast Radius

High. Deleting wrong files can damage websites, databases, backups, or application state.

Security Note

Never delete database files directly while database is running. Be careful with backups containing credentials or user data.

Strategic Value

Automation Opportunity

Automate daily df and du checks, alert above 80%, and rotate logs before emergency cleanup is needed.

Interview Value

Disk troubleshooting is a common real production task because full disk causes many unrelated-looking failures.

Related Concepts

df, du, inode, logrotate, backups, MySQL storage, uploads, cache, monitoring

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 *