Quick answer: Free space fast by clearing logs, package caches and old journals — journalctl --vacuum-size=100M and apt clean alone often recover gigabytes. Then find the real consumers with du before they fill the disk again, and consider expanding the disk if the workload has simply outgrown it.
Overview
A full disk breaks things in confusing ways: databases stop, sites throw 500 errors, sessions fail, even SSH logins can misbehave. Treat 100% usage as an incident — recover space first, investigate second.
Before you start
- Root SSH access (or the KVM Console if services already fail).
Step-by-step guide
- Confirm and locate the pressure:
Checkdf -h df -idf -itoo — a disk can be "full" out of inodes with free bytes. - Quick wins (safe on almost every server):
sudo journalctl --vacuum-size=100M sudo apt clean sudo rm -rf /tmp/* - Find the big directories from the root down:
sudo du -xh --max-depth=2 / 2>/dev/null | sort -rh | head -20 - Usual suspects: giant logs in
/var/log(truncate, don't delete open files:sudo truncate -s 0 /var/log/nginx/access.log), old backups stored locally, forgotten archives. - Restart anything that crashed while the disk was full:
sudo systemctl restart mariadb nginx - If the disk is legitimately too small, upgrade the plan and grow the filesystem — see expanding disk space after upgrade.
Common issues
- Deleted a huge file but space did not return: a process still holds it open — restart that service or find it with
lsof +L1. - Logs regrow overnight: configure logrotate instead of manual cleanup.
- Local backups eating the disk: move them off the server — that is exactly what a Storage VPS is for.
When to contact support
If df disagrees wildly with what you can find via du, or the filesystem went read-only after filling up and a reboot does not recover it, open a ticket with the outputs of steps 1 and 3.
Frequently asked questions
What is the fastest safe way to free disk space?
Vacuum the systemd journal to a fixed size, clean the package cache with apt clean, and truncate oversized logs. Together these commonly recover several gigabytes in under a minute.
I deleted files but df still shows the disk full — why?
A running process still holds the deleted files open, so the space is not released. Restart the service that owned them, or find such files with lsof +L1 and restart the matching process.
Can the disk be full when df shows free space?
Yes — the filesystem can run out of inodes while bytes remain. Check df -i; millions of tiny files, often cache or session files, exhaust inodes and behave exactly like a full disk.
Related articles
- How to check disk space
- How to expand disk space after upgrade
- Database connection error
- How to collect logs for support
Need a hand? Contact Cloud2Y support →
