Disk filled up to 100%
How to deal with a server that had its disk filled fully up
1. Enter your servers console
You can find instructions for this in the following articles:
For VPS: Entering the VNC console
For dedicated servers: Entering console
2. Log into your VPS
Then using your credentials that you have either set yourself within the server, or set at the reinstallation stage, log into your server.
3. Wipe the journal logs of your server
The most common cause of a disk being filled up is too many logs being generated.
You can wipe them with the following commands:
journalctl --rotate
journalctl --vacuum-time=1sAfterward, change the vacuum time setting to 2 days via the following command:
journalctl --vacuum-time=2d4. SSH into your server, and delete some files
Now, your server should regain its connectivity, and you should be able to SSH into your server once again.
Ncdu is a very useful tool in here. It will automatically scan all directories, and show you where the biggest files reside. You can install, and use it with the following commands:
sudo apt install ncdu
cd /
ncduWe recommend that you do not use your disk above ~90%. This will always leave some head room for new logs, and files generated by your applications.
Last updated