Technology

Checking Disk Space on Linux: The First Command in Any Health Check

Why df -h is still the first thing I run on a system-health review, and how to read its output without missing the warning signs.

Abstract illustration of server storage panels

Before looking at logs, dashboards or alerts, I run one command on every Linux server I review:

df -h

It takes a second, and it answers the question behind a surprising number of outages: is a filesystem about to fill up?

Reading the output

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        50G   41G  9.0G  82% /
/dev/sdb1       200G  188G   12G  94% /hana/log

Focus on the Use% column. Anything over 85% deserves a closer look; anything over 90% on a database log volume is urgent.

Finding what is using the space

Once you know which filesystem is filling, find what is filling it:

sudo du -xh /hana/log --max-depth=1 | sort -rh | head -10
  • -x stays on one filesystem, so you don’t wander into mounted volumes.
  • sort -rh puts the largest directories first.

Make it routine

A disk that fills slowly is easy to fix on a Tuesday afternoon and painful to fix at 3 a.m. Put the check into your monitoring, but keep the habit of running it by hand — it’s the fastest way to understand a system you’ve just logged into.

Keep Reading

Related articles

Let’s Talk

Let’s build something reliable together

Open to consulting, speaking and collaboration across SAP administration, cloud infrastructure and cybersecurity — questions are always welcome.