Quick answer: df -h shows how full each filesystem is; du -sh /var/* 2>/dev/null | sort -h shows what's eating space; ncdu / gives an interactive browser. Keep at least 10–15% free — a 100% full disk breaks databases and even SSH logins.

Overview

Disk usage grows silently: logs, caches, old backups, docker images. Checking takes seconds and prevents the classic "everything stopped working" incident caused by a full root filesystem.

Before you start

  • SSH access.
  • Optionally install ncdu:
    apt install -y ncdu     # Ubuntu / Debian
    dnf install -y ncdu     # AlmaLinux / Rocky

Step-by-step guide

  1. Overall usage:
    df -h
    Look at the / line (and /var, /home if separate).
  2. Find the heavy directories:
    du -xh / --max-depth=2 2>/dev/null | sort -h | tail -20
  3. Interactive exploration:
    ncdu -x /
    Navigate with arrows, delete carefully with d.
  4. Usual suspects:
    journalctl --disk-usage
    du -sh /var/log /var/cache /tmp
    docker system df        # if you use Docker
    Trim the systemd journal: journalctl --vacuum-size=200M; clean apt cache: apt clean; prune docker: docker system prune.
  5. Watch inodes too — millions of tiny files can exhaust them while df shows free space:
    df -i

Common issues

  • Deleted a huge file but space didn't return? A process still holds it open — find it with lsof +L1 and restart that service.
  • df and du disagree? Same cause as above, or data hidden under a mount point.
  • Disk genuinely too small? Upgrade the disk — Storage VPS plans offer large volumes at low cost.

When to contact support

If the disk is 100% full and the server misbehaves badly (can't log in, database down), see the out-of-disk emergency guide or open a support ticket.

Frequently asked questions

How much free space should I keep?

Keep at least 10-15% of the disk free at all times. A filesystem that hits 100% breaks databases, stops logging and can even prevent SSH logins, so act well before you reach that point.

I deleted files but space did not come back — why?

A running process still holds the deleted files open, so the kernel cannot release their blocks yet. Find the holder with lsof +L1 and restart that service to reclaim the space.

What fills the disk most often?

Logs (/var/log, journald), package caches, old backups and Docker images. journalctl --vacuum-size and docker system prune reclaim a lot.

Related articles

Need a hand? Contact Cloud2Y support →

Was this answer helpful? 0 Users Found This Useful (0 Votes)