← Back to Error Index
root@linuxfix:~/enospc$
ENOSPC
No space left on device

Solutions

Prerequisites: Start by updating your system to resolve common issues and ensure the solutions provided below are compatible with your current environment.
check_latest_version && sudo apt update && sudo apt upgrade -y
Check disk usage

Identify space usage:

df -h
du -sh /*
du -sh /path/* | sort -hr
Free up space

Remove unnecessary files:

sudo apt autoremove
sudo journalctl --vacuum-time=7d
find /tmp -type f -atime +7 -delete
Check inodes

Verify inode usage:

df -i
find /path -type f | wc -l
for dir in /*; do echo "$dir: $(find "$dir" -type f | wc -l)"; done

What is ENOSPC?

ENOSPC occurs when there is insufficient space on the storage device to complete an operation.

Common scenarios: Disk full, inode exhaustion, or writing to filesystems at capacity.

Common Causes

  • Disk space completely used
  • Inode table full
  • Large log files
  • Temporary files accumulation
  • Snapshot or backup files

Debugging Tips

lsof | grep deleted
du -x --max-depth=1 /
find / -size +100M -type f
stat -f /path

Prevention

  • Monitor disk usage regularly
  • Set up log rotation
  • Clean temporary files periodically
  • Use disk quotas
errno disk space storage