Checked
2026-11-14
/ Disk full

No space left on device. Find what filled the disk.

A full disk is the most common outage on a small server, and it looks like everything else: the database stops, uploads fail, pages show errors, sometimes even an SSH login hangs. Find out what filled it before you delete anything.

Confirm it

df -h shows each filesystem and how full it is. 100 percent on /, or on the one that holds /var, is your answer.

If df shows free space and you still get the error, run df -i. A filesystem can run out of inodes, the slots for files, when something writes millions of small files: sessions, cache entries, mail stuck in a queue.

Find what filled it

  • du -xh --max-depth=1 / | sort -h lists each top-level folder on that filesystem by size, biggest last. Repeat inside the biggest one until you reach the cause.
  • journalctl --disk-usage shows how much the system journal takes.
  • find / -xdev -type f -size +500M lists single big files: old backups, database dumps, core dumps, video uploads.
  • lsof +L1 lists files that were deleted but are still held open by a process. Their space comes back only when that process closes them or restarts.
  • docker system df, on a server that runs Docker, shows the space taken by images, containers and volumes.

Freeing space without breaking anything

  • Logs: journalctl --vacuum-size=500M trims the journal. For a huge log a service still writes to, truncate -s 0 empties the file in place; rm would leave the space held until the service restarts.
  • Packages: apt-get clean drops the cache of downloaded packages. apt autoremove removes old kernels and packages nothing needs; read the list before you say yes.
  • Old backups and dumps on the same disk: move them off the server. A backup on the disk it is meant to protect does not protect it.
  • Docker: docker image prune removes unused images. docker system prune goes further, and with --volumes it deletes data, so read what it lists before you confirm.

Afterwards

Restart what stopped while the disk was full: systemctl --failed lists it, and the database is often there.

Then find out why it filled: a log with no rotation, a backup job that never deletes old copies, a debug setting left on, a cache that only grows. Check that logrotate covers the app's own logs, set SystemMaxUse= in /etc/systemd/journald.conf, and have something warn you when the disk passes 80 percent.

What not to do

  • Do not delete anything under /var/lib/mysql or /var/lib/postgresql. Those big files with odd names are the database.
  • Do not delete a MySQL binary log by hand. PURGE BINARY LOGS in the mysql client removes old ones safely.
  • Do not run rm -rf with a wildcard or a variable you have not printed with echo first.

When to stop and hand it over

Stop if the space is taken by the database itself, if the database will not start now that the disk has room, or if you cannot tell what a big folder is for. Our Server Rescue is one incident at a fixed $69, with a same-day start listed at $109, and nothing to pay if we cannot fix it. Nothing gets deleted that we have not identified first.

/ Questions

Questions people ask

What fills a server's disk most often?
Logs that are never rotated, backups kept on the same disk, and on Docker hosts old images. du shows which in a minute.
I deleted files and df still says the disk is full. Why?
A running process still holds them open. lsof +L1 lists them, and restarting that service gives the space back.
Can a full disk damage the database?
It can stop it in the middle of a write. MySQL, MariaDB and PostgreSQL recover on restart in most cases, but read the database's log after it starts and take a backup before anything else.
What does fixing a full disk cost?
With us, Server Rescue at $69 for the incident, or $109 for a same-day start. If we cannot fix it, you pay nothing.
/ Sources

Where each statement comes from

Checked against the sources on .

More server help