df / du / ncdu
-x/-xdev is the key to a clean result: count only the current filesystem,
without descending into mounted and virtual ones (/proc, /sys).
Where the space and inodes went — df, du, finding large files, pitfalls.
df -h
free space per partition
df -i
free inodes per partition
du -xh --max-depth=1 / | sort -h
top directories (within one filesystem)
ncdu /
interactive overview
sudo lsof +L1
deleted-but-open files
sudo journalctl --vacuum-time=7d
trim the system journal
sudo apt clean
clear the package cache
Two independent reasons for "disk full":
df -h;df -i. This happens with millions of small files; there's space, but you
can't create a file.The approach: df -h and df -i → find the partition → du/ncdu top-down
to the culprit.
-x/-xdev is the key to a clean result: count only the current filesystem,
without descending into mounted and virtual ones (/proc, /sys).
A file was deleted but is still open by a process — the space isn't freed until it closes:
Restart the process holding it (often a log that got rotated incorrectly).
df -h shows free spaceYou're out of inodes: df -i. Find the directory full of tiny files and clean it up:
du -sh /var/log/*; set up rotation (logrotate) and the journal
(journalctl --vacuum-time=, see journalctl).
Either a deleted-but-open file (see lsof +L1 above), or it's a different
partition — check df -h path.
Found an inaccuracy? Report an error in the article