Skip to content

Did you know?

"No space left on device" with free space usually means the file system ran out of inodes.

Check with df -i: every file needs one inode, and millions of tiny files can use them all.

Explained

Every file and directory on ext4 needs an inode, a small record that stores its metadata. The number of inodes is fixed when the file system is created. If an application creates millions of small files, such as PHP sessions, cache entries or mail queue files, the inodes can run out while there is still plenty of free space. New files then fail with “No space left on device”.

df -i
Filesystem      Inodes   IUsed IFree IUse% Mounted on
/dev/sda1      6553600 6553600     0  100% /

Find the directories with the most files:

sudo du --inodes -x / 2>/dev/null | sort -n | tail -15

Clean up the old files there, usually caches or sessions, and fix whatever stopped cleaning them, often a missing cron job or log rotation. You can’t add inodes to an existing ext4 file system; if a disk will hold lots of tiny files, create it with more inodes (mkfs.ext4 -i 8192) or use XFS, which allocates inodes dynamically.

Learn more

← All tech tips · Suggest a fix

Back to top