Linux ENOSPC (errno 28) — No Space Left on Device (Deep Dive)
Errorerrno
Overview
Deep dive into ENOSPC covering inode exhaustion, reserved blocks, journal space, tmpfs/RAM disk full, and Docker overlay filesystem space issues.
Key Details
- ENOSPC can occur even when df shows free space — check inode usage with df -i
- ext4 reserves 5% of space for root by default (tune2fs -m to adjust)
- Inode exhaustion: millions of tiny files can exhaust inodes while disk space remains
- Docker: container overlay filesystem shares the host's /var/lib/docker partition
- tmpfs (including /tmp, /dev/shm) is backed by RAM and has size limits
Common Causes
- Disk genuinely full from logs, downloads, or application data
- Inodes exhausted — too many small files on the filesystem
- Reserved blocks preventing non-root users from writing (ext4 5% reserve)
- Docker images and containers filling up /var/lib/docker
- tmpfs (RAM disk) at capacity, especially /dev/shm for shared memory
Steps
- 1Check disk space: df -h and inode usage: df -i
- 2Find large directories: du -sh /* | sort -rh | head -20
- 3Clean Docker: docker system prune -a --volumes (removes unused images, containers, volumes)
- 4Reduce ext4 reserved blocks: sudo tune2fs -m 1 /dev/sdXY (reduce from 5% to 1%)
- 5Find and clean old log files: find /var/log -name '*.gz' -mtime +30 -delete
Tags
linuxenospcerrno-28disk-fullinodes
More in Errno
linux-errno-1-epermLinux errno 1 (EPERM) — Operation Not Permitted
Warninglinux-errno-2-enoentLinux errno 2 (ENOENT) — No Such File or Directory
Warninglinux-errno-5-eioLinux errno 5 (EIO) — Input/Output Error
Errorlinux-errno-11-eagainLinux errno 11 (EAGAIN) — Resource Temporarily Unavailable
Informationallinux-errno-12-enomemLinux errno 12 (ENOMEM) — Out of Memory
Criticallinux-errno-13-eaccesLinux errno 13 (EACCES) — Permission Denied
WarningFrequently Asked Questions
Check inodes: df -i. Millions of tiny files can exhaust inodes while disk space remains. Also check if you are a non-root user hitting the 5% reserved blocks.