SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
System Added 13 October 2025

Linux: No space left on device

File system is full. Cannot write files or create directories.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
# Check disk usage
df -h
# Find large directories
du -sh /* | sort -hr | head -20
# Clean package cache
sudo apt clean
# Clean logs
sudo journalctl --vacuum-time=7d

How to diagnose System errors

System-level errors are usually a resource limit being hit: disk, inodes, file descriptors, memory or process count. Two traps recur. "No space left on device" can mean inodes are exhausted while df -h shows free space. And a process that vanished without an error in its own log was almost certainly killed by the OOM killer, which logs to the kernel ring buffer rather than to the application.

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Check both space and inodes: df -h and df -i. Millions of tiny files exhaust inodes long before bytes.
  2. For processes that disappear, search the kernel log: dmesg -T | grep -i -E 'oom|killed process' or journalctl -k.
  3. For systemd units, systemctl status unit then journalctl -u unit -n 200 --no-pager. The status output truncates the useful part.
  4. For "too many open files", check both the limit and the usage: ulimit -n, cat /proc/<pid>/limits, and ls /proc/<pid>/fd | wc -l. systemd services need LimitNOFILE, not a shell ulimit.
  5. For cron jobs that work manually but not scheduled, remember cron has a minimal environment and no PATH. Use absolute paths and log stdout and stderr to a file.

Tools worth reaching for

  • df -h / df -i
  • dmesg -T
  • journalctl -u
  • lsof / ss
  • systemd-analyze blame
  • ncdu

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

linux.die.net

Related System errors

See all 26 System errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.