Error message
No space left on device
A filesystem is full — confirm which one, and whether you ran out of bytes or inodes.
Quick diagnosis
Start here. This one command usually tells you which of the causes below you are dealing with:
$ df -h && df -i The first shows space, the second shows inodes. Run both before touching anything — they tell you two different stories and the fix differs completely.
Causes, ordered by how often they are the culprit
1 Logs that grew without rotation (most common on servers)
An application logging errors in a loop can fill hundreds of gigabytes overnight. /var is where this almost always happens.
$ du -h --max-depth=1 /var 2>/dev/null | sort -hr | head $ sudo journalctl --vacuum-size=200M For plain files, truncate rather than delete a log a process still holds open: sudo truncate -s 0 /var/log/huge.log. Deleting it would not free the space until the process restarts.
2 Deleted files still held open by a process
The classic head-scratcher: you delete a huge file, du no longer sees it, and df still reports the disk full. The space is not released until the process holding it closes the file.
$ sudo lsof +L1 | sort -k7 -n | tail $ sudo systemctl restart theservice 3 Out of inodes, not bytes
Every file consumes an inode. Millions of tiny files — session files, mail queues, cache — can exhaust them while df -h still shows free space.
$ df -i $ find /the/directory -type f -delete If IUse% is at 100% while Use% is not, this is your cause. Find the offender with: for d in /*; do echo "$(find $d -xdev 2>/dev/null | wc -l) $d"; done | sort -rn | head.
4 Docker images, containers and volumes
On development machines and CI runners this is the usual culprit. Docker accumulates layers and orphaned volumes silently.
$ docker system df $ docker system prune -a --volumes That last command deletes unused images AND volumes. Make sure you are not relying on any of them before running it.
5 A different filesystem than the one you checked
/home, /var or /boot are often separate mounts. /boot in particular is small and fills up with old kernels.
$ df -h /the/exact/path/you/were/writing/to $ sudo apt autoremove --purge # clears old kernels from /boot 6 Package manager and build caches
Downloaded packages and build artefacts accumulate quietly.
$ du -sh /var/cache/apt ~/.cache 2>/dev/null $ sudo apt clean && rm -rf ~/.cache/* How to stop it happening again
- Set up monitoring that alerts at 80% rather than discovering this at 100%. A one-line cron with df and mail is better than nothing.
- Make sure logrotate covers every application log, including those your own services write.
- On servers running Docker, schedule a periodic docker system prune.
- Keep the journal bounded: SystemMaxUse=500M in /etc/systemd/journald.conf.
Frequently asked questions
df says the disk is full but du finds nothing — why?
Deleted files still held open by a running process. Find them with sudo lsof +L1 and restart the process that holds them.
The disk has free space but I still get this error
Check df -i. You are probably out of inodes, which happens with huge numbers of very small files. Deleting files (not freeing bytes) is the fix.
Can I just delete files in /var/log?
Rotated files (.gz, .1) are safe to delete. For an active log, truncate it instead — deleting a file a process has open frees nothing until that process restarts.
Why did /boot fill up?
Kernel updates keep old versions. sudo apt autoremove --purge removes the ones no longer needed.
Commands involved
See free space per filesystem and find what is eating your disk, directory by directory.
findLocate files anywhere in a directory tree by name, type, size, date — and act on them.
journalctlQuery the system journal: by service, time window, priority — and follow live.
rmDelete files and directories — and understand -r, -f and why there is no trash bin.
Concepts behind this error: Inode · Mount · Filesystem hierarchy
How to do it properly
See how much space is left, and find out what is using it.
Find large files in LinuxLocate large files without crossing into other mounted filesystems.
Other errors
SSH rejected your login because no key you offered was accepted by the server.
bash: command: command not foundThe shell searched every directory in your PATH and found no executable with that name.
No such file or directoryThe path you gave does not resolve — but often the missing part is not the one you think.
Permission deniedThe path resolves fine — the system simply will not let you do that with it.