whyfull

Why is my Linux disk full?

whyfull finds what's filling a Linux disk and gives you the command that frees each thing, marked safe, review or caution. It never deletes anything itself.

/ is 100% full 4.0 GB used of 4.1 GB

What whyfull found on a full 4 GB test server. All but 260 MB of the used space could be freed, and each item came with its fix.
  • 700 MB Deleted log still open by nginx caution
  • 560 MB Docker log of container api caution
  • 412 MB Unused Docker images review
  • 390 MB 3 old kernels review
  • 360 MB systemd journal over 200 MB review
  • 280 MB Rotated logs in /var/log review
  • 240 MB apt package cache safe
  • 238 MB Docker build cache safe
  • 220 MB pip cache safe
  • 200 MB Old files in /tmp review
  • 140 MB Crash dumps review
  • 260 MB Everything else kept

Run it on the full server. It's one file with no dependencies, downloaded into memory so it works even with no free space:

curl -fsSL -o /dev/shm/whyfull \
  https://github.com/amlaban65/whyfull/releases/latest/download/whyfull.pyz
sudo python3 /dev/shm/whyfull

Needs Python 3.6 or newer. Also on PyPI: pipx install whyfull.

Guides

Fixing it by hand? Each guide covers one common cause, with the commands to find it and free the space.

What a report looks like

whyfull report for a full root filesystem, listing each finding with its size, risk and fix command