No Space Left on Device
Production Risk
A full production filesystem will cause write failures across all services. Set up disk space alerts at 80% and 90% thresholds.
The filesystem has no free blocks remaining. This prevents any new data from being written. Note that a filesystem can also return ENOSPC when inodes are exhausted even if block space is available.
- 1The filesystem partition has filled up entirely.
- 2Inode count is exhausted even though disk blocks remain free.
- 3A runaway log file or core dump filled the filesystem.
- 4A large number of small files exhausted the inode table on an ext4 filesystem.
Writing to a filesystem that has run out of free space.
$ cp large_file.iso /mnt/full/ cp: error writing '/mnt/full/large_file.iso': No space left on device
expected output
cp: error writing '/mnt/full/large_file.iso': No space left on device
Fix
Free disk space by removing large or unnecessary files
WHEN When the filesystem is genuinely full
# Find largest directories du -sh /* 2>/dev/null | sort -rh | head -20 # Check inode usage too df -i # Rotate or truncate large log files sudo truncate -s 0 /var/log/syslog
Why this works
Removing files frees the blocks they occupied, allowing new writes to succeed.
✕ Delete files and expect immediate space recovery without syncing
Files with open handles are not removed from disk until all handles are closed, even if unlinked.
Linux Programmer Manual errno(3)
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev