Skip to content

Free disk space

To see how much space is left on each filesystem, use df (disk free).

Terminal window
df -h

-h prints sizes in human-readable units (K, M, G).

Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p2 98G 61G 33G 65% /
/dev/nvme0n1p1 511M 6.1M 505M 2% /boot/efi
tmpfs 3.9G 0 3.9G 0% /dev/shm
Column Meaning
Size Total size of the filesystem
Used Space in use
Avail Space still available to normal users
Use% Percentage used
Mounted on Where the filesystem is mounted
Terminal window
df -h /var/log # only the filesystem that holds this path
df -hT # add the filesystem type (ext4, xfs, tmpfs…)
df -h -x tmpfs -x devtmpfs # hide in-memory filesystems
df -i # inodes instead of bytes

No space left, but df shows free space. Check the inodes with df -i. If IUse% is at 100 %, the filesystem has run out of inodes, usually because of millions of tiny files (caches, sessions, mail queues).

Size ≠ Used + Avail. On ext4, about 5 % of the blocks are reserved for root by default, so they don’t show up in Avail. You can check the reserved count with:

Terminal window
sudo tune2fs -l /dev/nvme0n1p2 | grep -i "reserved block count"

df says the disk is full, but du doesn’t add up. A process is probably still holding a deleted file open, so the space isn’t released until that process closes it or restarts. To find them:

Terminal window
sudo lsof +L1
  • Disk usage, to find out what is using the space.
  • man df