Overview
A full disk causes failed writes, crashed databases and services that will not start. This article shows how to find what is consuming space and reclaim it safely.
Before you begin
- Root or sudo access.
- Careful judgement: delete only files you understand. When in doubt, take a snapshot first.
Steps
- Confirm which filesystem is full:
bash
df -h
- Find the biggest directories, starting at the root:
bash
sudo du -xh / --max-depth=1 | sort -h
Then drill into the largest one, for example /var:
bash
sudo du -xh /var --max-depth=1 | sort -h
- Clear the usual suspects:
- Systemd journal:
bash
sudo journalctl --disk-usage
sudo journalctl --vacuum-size=200M
- Old logs: check
/var/log, and ensurelogrotateis running (cat /etc/logrotate.conf). - Package cache:
```bash sudo apt clean
or
sudo dnf clean all ```
- Old kernels: remove unused kernels via your package manager.
- Find large individual files:
bash
sudo find / -xdev -type f -size +500M -exec ls -lh {} \; 2>/dev/null
- Check for deleted-but-open files that still hold space (common with busy services):
bash
sudo lsof | grep deleted
Restarting the service holding the file releases the space.
- Check backups, container images and temp directories —
/var/lib/docker,/tmp,/var/tmpand app upload folders often grow quietly. - Add capacity if needed. Resize the disk or add a Storage Box in the ALYPOD Console and move backups and archives there.
Troubleshooting
- Problem:
dfsays the disk is full butdufinds nothing. Solution: Uselsof | grep deleted— a process is holding a deleted file open. - Problem: You cannot log in because the disk is full. Solution: Use the VNC console, clear the journal and apt cache, then investigate further.
Related articles
- [Diagnosing high CPU or memory usage]
- [The server will not boot]
- [Keeping your server patched]
