Error Codes Wiki

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

  1. 1Check disk space: df -h and inode usage: df -i
  2. 2Find large directories: du -sh /* | sort -rh | head -20
  3. 3Clean Docker: docker system prune -a --volumes (removes unused images, containers, volumes)
  4. 4Reduce ext4 reserved blocks: sudo tune2fs -m 1 /dev/sdXY (reduce from 5% to 1%)
  5. 5Find and clean old log files: find /var/log -name '*.gz' -mtime +30 -delete

Tags

linuxenospcerrno-28disk-fullinodes

More in Errno

Frequently 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.