Fix "No Space Left on Device" on Linux
No space left on devicedisk fullwrite error"No space left on device" stops a server from writing — saves, logs, databases all fail. Usually the disk is genuinely full, but sometimes it's inodes or Docker layers. Here's how to find and fix it, and stop it recurring.
The disk is usually genuinely full — but the confusing cases (df shows free space, yet writes still fail) trip people up. Match your situation:
| Symptom | Cause | How to confirm |
|---|---|---|
| df -h shows the disk 100% full | Disk genuinely full | du -sh /* to find the big folders |
| df -h shows free space, but writes fail | Out of inodes (too many tiny files) | df -i shows 100% on that filesystem |
| Space "used" but nothing visibly there | Deleted-but-open files still held | lsof +L1 lists them; restart the holder |
| Only one folder fails | A separate mount/partition is full | df -h and check that mount specifically |
| Fills up fast on a Docker host | Old images/layers/volumes | docker system df, then docker system prune |
Confirm what's full
Check disk usage per filesystem first:
df -h # space used per filesystem
df -i # inode usage (the sneaky one)
Find the big folders
Track down what's eating space, largest first:
du -sh /* 2>/dev/null | sort -h
du -sh /home/* /var/log/* | sort -h
The usual culprits
- Log files — runaway logs in
/var/logor a server's logs folder. - Backups — old world/database backups piling up.
- Crash dumps / core files — large hs_err / core files.
- Temp files — leftovers in
/tmpor download caches.
If df -h shows free space but writes still fail, df -i is the answer — you ran out of inodes (too many tiny files). Delete large numbers of small junk files (old cache/session files) to recover.
Free space safely
Delete old logs/backups you don't need, truncate a giant active log rather than deleting it, and set up log rotation so it can't happen again:
truncate -s 0 /path/to/huge.log # empty a live log safely
journalctl --vacuum-size=200M # trim systemd journals
df -h for space, df -i for inodes, du to find the hog. Clear logs/backups, set up rotation, and you're back.
Docker and quota-specific causes
- Unused Docker images, stopped containers and dangling build layers under
/var/lib/docker/overlay2can silently consume tens of GB —docker system prune(carefully, after reviewing what it will remove) reclaims it. - Some hosting plans enforce a separate storage quota below the actual disk size — if df -h shows plenty of space but writes still fail, see fixing disk quota exceeded.
- Game server auto-save/backup features (world saves, database dumps) can accumulate faster than expected on a busy server — cap how many old backups are kept.
How to prevent it recurring
- Set up log rotation (logrotate) for anything that writes continuously.
- Cap the number of retained backups instead of keeping them forever.
- Monitor disk usage with alerts before it hits 90%+, not after a crash.
NVMe storage, monitored
Our hosting runs on fast NVMe with sensible defaults and monitoring, so a full disk doesn't take you offline.
Frequently asked questions
Why does Linux say "no space left" when df shows free space?
You've likely run out of inodes, not bytes. Run df -i — if inode use is at 100%, too many small files filled the table. Delete large numbers of tiny junk files to recover.
How do I find what's using my disk space?
Use du -sh /* | sort -h to see the biggest top-level folders, then drill down. Common culprits are logs, old backups, crash dumps and temp files.
How do I safely empty a huge log file?
Use truncate -s 0 /path/to/file.log to empty it without deleting it (so the running process keeps writing). Then set up log rotation to stop it recurring.
Can Docker fill up my disk even if I don't see big files anywhere obvious?
Yes — unused images, stopped containers and build cache layers live under /var/lib/docker and don't show up in a casual du of /home or /var/log. Check docker system df and prune carefully.
What's the difference between "no space left" and "disk quota exceeded"?
No space left means the filesystem itself is full. A quota error means a per-account/per-directory limit set by your hosting plan was hit, even though the underlying disk may have room — the fixes differ.
How often should I check disk usage to avoid this?
Set up automated monitoring/alerts at a threshold like 80-90% rather than checking manually — by the time df -h shows 100%, services are already failing.
Related articles
Fix SSH "Connection refused" / "Connection timed out"
SSH "connection refused" vs "timed out" — what each means and the exact steps to fix them.
Read fix Linux & VPSFix "Permission denied" on Linux (chmod & chown Explained)
"Permission denied" on a script or file? Understand chmod/chown and fix it the right way.
Read fix Linux & VPSHow to Check CPU, RAM & Disk Usage on a Linux Server
The essential commands to check CPU, RAM and disk on Linux — and find what's eating them.
Read fix