← Back to all fixes

Disk full — no space left on device

The Issue

Writes fail with "No space left on device" but `df -h` shows only 60% used.

Root Cause

Inodes exhausted, not disk blocks. Each file uses one inode regardless of size. Thousands of tiny files (logs, temp files, mail queue) can exhaust inodes while disk space looks fine.

How to Fix
  1. Check inodes: `df -i` — if IUse% is near 100%, inodes are the problem
  2. Find directories with most files: `find / -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -rn | head`
  3. Common culprits: /var/spool/mail, /var/log, /tmp — clean up old files
  4. Delete old logs: `sudo journalctl --vacuum-time=7d` or `sudo find /var/log -name "*.gz" -delete`
  5. For actual disk full: find large files with `du -sh /* | sort -rh | head -20`