Skip to content
VDS · Troubleshooting

Ran out of disk space

How to quickly find what is eating up the disk, free gigabytes safely, and understand the pitfalls: deleted open files and exhausted inodes.

Updated August 23, 2026

A full disk breaks everything at once: the database stops accepting writes, the site returns errors, journalctl refuses to work, and sometimes even SSH won't let you in, because there's nothing left to write to the session log. You need to act fast and in order.

Check

df -h
df -i

The first command shows space, the second shows inodes. Full inodes produce the same "No space left on device" error even with gigabytes free: this happens when a directory has accumulated millions of tiny files (PHP sessions, cache, queues).

You can also see used space in the panel at /hosting/vds/m/<id> — the ring on the "Overview" tab. It's filled from data reported by the qemu-guest-agent; if the agent has been removed, the ring stays empty and the panel shows the install command instead.

Find the culprit

du -xh --max-depth=1 / 2>/dev/null | sort -h | tail -15
du -xh --max-depth=1 /var 2>/dev/null | sort -h | tail -15
ncdu -x /                     # apt install ncdu, interactive
find / -xdev -type f -size +500M -exec ls -lh {} \; 2>/dev/null

The -x flag keeps the search within a single filesystem and stops it from wandering into /proc and mounted directories.

Typical offenders: logs in /var/log, package cache in /var/cache, Docker images and volumes in /var/lib/docker, database dumps, forgotten archives in /root and /tmp, files from old application releases.

Free up space

journalctl --vacuum-size=200M
apt clean                                   # Debian, Ubuntu
dnf clean all                               # AlmaLinux, CentOS Stream
docker system prune -af --volumes           # careful: will remove unused volumes
find /tmp -type f -mtime +7 -delete

To cap the journal permanently, edit /etc/systemd/journald.conf (SystemMaxUse=300M); see the article systemd journals for details. For application files, set up logrotate: without rotation, a single app.log can easily grow to tens of gigabytes.

Trap: a deleted but still open file

You deleted a giant log, but df shows the same numbers. As long as a process keeps the file open, the space isn't returned.

lsof +L1 | head -20

The right fix is to restart the service holding the file (systemctl restart nginx), or to truncate the file without deleting it:

: > /var/log/nginx/access.log

Trap: out of inodes

df -i
find /var/www -xdev -type d -printf '%h\n' | sort | uniq -c | sort -rn | head

Look for a directory with hundreds of thousands of files and clean it up in chunks so you don't take the machine down:

find /var/lib/php/sessions -type f -mtime +2 -delete

If there is no space at all

When the disk is 100% full and the system is barely moving, log in through the "Console" tab in the panel, free up at least a hundred megabytes (journalctl --vacuum-size=50M almost always works), and continue troubleshooting normally. In a really bad case, the rescue disk will help: the machine boots into SystemRescue, your disk shows up as /dev/sda, and you mount it and clean up from the outside.

To keep it from happening again

  • An alert at the 85% threshold — see Site downtime alerts.
  • Rotate all application logs, not just system ones.
  • Send database dumps and archives off the server right away, instead of keeping them in /root.
  • If there's nothing left to clean and your data keeps growing, move up to a tier with a bigger disk: 40, 80, 120, 160, 200 and 250 GB. Upgrades only: disks can't be shrunk, and downgrades aren't available.

Don't delete files from /var/lib and /usr at random: that's where database data and system packages live. First figure out what a directory belongs to, and only then clean it up.