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. Here's how to find and fix it.
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.
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.
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