No Space Left on Device
Linux Linux
Severity: CriticalWhat Does This Error Mean?
The 'No space left on device' error means your Linux partition is completely full. Even if it seems like you have plenty of space, the disk might be 100% used by log files, cached packages, temporary files, or a runaway process writing to disk. You need to identify what is using the space and delete or move it.
Affected Models
- Ubuntu
- Debian
- Fedora
- CentOS
- Arch Linux
- Linux Mint
- openSUSE
Common Causes
- Log files have grown without limit and consumed all available disk space
- Package manager cache (apt or dnf) has accumulated gigabytes of old package files
- Docker containers, images, and volumes are consuming large amounts of space
- A runaway process is writing to a file or log at a very high rate
- The disk or partition was too small to begin with and has gradually filled up
How to Fix It
-
Check overall disk usage. Open a terminal and run: df -h to see how full each partition is. The column 'Use%' shows what percentage is used. If it shows 100%, that is the problem partition.
The output shows every mounted partition. The one mounted at / (root) is usually the main system partition.
-
Find the largest directories. Run: sudo du -sh /* 2>/dev/null | sort -rh | head -20 to see which top-level directories use the most space.
This gives you a ranked list. Common culprits are /var (logs, databases), /home (user files), /tmp (temporary files), and /var/lib/docker (Docker).
-
Clean the package manager cache. On Debian/Ubuntu run: sudo apt clean && sudo apt autoremove. On Fedora run: sudo dnf clean all. On Arch run: sudo pacman -Sc
Package managers keep downloaded package files in a cache. Over time this can grow to several gigabytes. Cleaning it is completely safe.
-
Clean old log files. Run: sudo journalctl --vacuum-size=500M to keep only 500 MB of system logs. Also check /var/log/ for large log files: ls -lhS /var/log/
System logs can grow into gigabytes on busy systems. The journalctl vacuum command trims the systemd journal safely.
-
Remove old kernel versions. Run: sudo apt autoremove (Ubuntu/Debian) to remove kernels you are not currently using. Each unused kernel can take 400 to 600 MB.
Linux keeps old kernels so you can boot into them if a new one breaks something. You only need the last two or three.
When to Call a Professional
A full disk is always fixable by finding and deleting the right files. You do not need professional help unless the disk is so full that Linux itself cannot function (even commands fail). In that case, boot from a live USB and run the cleanup commands from there.
Frequently Asked Questions
The disk shows as full but I cannot find what is using the space. What now?
Some space can be hidden in deleted files that are still held open by a running process. Run: sudo lsof | grep deleted to find these. Restarting the process holding the deleted files open will free that space immediately.
How much free space should I keep on a Linux partition?
Keep at least 10 to 15% of each partition free. Linux file systems (ext4, xfs) reserve 5% for the root user by default to prevent the system from becoming completely unusable when the disk fills up. If you are below 5% free, performance degrades significantly.
Can a full disk break my Linux installation?
Yes — a completely full root partition causes serious problems. Log files cannot be written, programs cannot create temporary files, and some daemons will crash. If you can still open a terminal, clean up immediately. If the system is too broken to function, boot from a live USB to clean up from outside.