Fixing "No Space Left on Device" When Disk Shows Free Space
Seeing "No space left on device" errors on your Breeze when df shows available space is a common and confusing situation. The culprit is almost always inode exhaustion -- the filesystem has run out of metadata entries even though block storage remains available.
Confirm Inode Exhaustion
df -i
Look for a filesystem showing 100% inode usage. Compare this with regular disk usage:
df -h
Find Directories with Excessive Files
Locate where the inodes are being consumed:
sudo find / -xdev -type d -exec sh -c 'echo "$(find "$1" -maxdepth 1 | wc -l) $1"' _ {} \; | sort -rn | head -20
Common culprits include mail queues, session files, cache directories, and log rotation remnants.
Clean Up Small Files
Once you identify the problematic directory, remove unneeded files:
# Example: clean old PHP session files
find /var/lib/php/sessions -type f -mtime +7 -delete
# Example: clean mail queue
find /var/spool/mail -type f -empty -delete
Prevent Future Exhaustion
- Set up cron jobs to regularly clean temporary file directories
- Configure log rotation to compress and remove old log files
- Monitor inode usage alongside disk space in your alerting system
- For new filesystems, specify a higher inode count at creation time with
mkfs.ext4 -N
Other Causes
If inodes are not exhausted, check for deleted files still held open by processes:
sudo lsof +L1
Restarting the process holding the deleted file will release the disk space immediately.