Free disk space
To see how much space is left on each filesystem, use df (disk free).
Quick look
Section titled “Quick look”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/efitmpfs 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 |
Useful variants
Section titled “Useful variants”df -h /var/log # only the filesystem that holds this pathdf -hT # add the filesystem type (ext4, xfs, tmpfs…)df -h -x tmpfs -x devtmpfs # hide in-memory filesystemsdf -i # inodes instead of bytesGotchas
Section titled “Gotchas”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:
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:
sudo lsof +L1See also
Section titled “See also”- Disk usage, to find out what is using the space.
man df