Operations 4 min read

Diagnosing Disk Space Issues on Linux with df and du Commands

This article walks through troubleshooting a failed deployment caused by a full disk, showing how to use df -h to check overall disk usage and various du options (including --max-depth and -sh) to pinpoint large directories and resolve the issue.

Raymond Ops
Raymond Ops
Raymond Ops
Diagnosing Disk Space Issues on Linux with df and du Commands

While publishing a test service via a web release platform, one of two nodes failed to start, causing TPS to stay low; log inspection revealed an "IO" error indicating the disk was full.

Check overall disk space: use the command df -h to display free space on all mounted filesystems.

View usage per subdirectory: run du --max-depth=1 -h (default path is the current directory). The -h flag makes sizes human‑readable (K, M, G). The output lists each subdirectory’s size and a total line.

Get the size of a specific directory: use du -sh. This prints a summarized, human‑readable size for the current directory.

Alternative command: du --max-depth=0 -h produces the same result as -s, showing only the total size.

You can also specify a path, e.g., du -sh /root/sw, to check the size of a particular directory.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

OperationsLinuxtroubleshootingdisk spacedudf
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.