Hi!
My site is back, but i can’t make any editions. As soon as I try to save anything, i get a 502 Bad Gateway. Looking here and there i am finding out that i am running out of disk space. How to clean it and how to avoid it being full again… something is wrong… Someone gives a hand?
sudo df -h
Filesystem Size Used Avail Use% Mounted on
udev 487M 0 487M 0% /dev
tmpfs 100M 11M 89M 11% /run
/dev/vda1 30G 30G 0 100% /
tmpfs 497M 0 497M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 497M 0 497M 0% /sys/fs/cgroup
tmpfs 100M 0 100M 0% /run/user/1000
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
You could use a command like this to help figure out where the disk usage is coming from:
du -a / | sort -nr | head -n 10
It lists the size of all files in the /
directory, sorts them by size descending, and then prints only the ten largest files (useful if a directory has a lot of files).
Based on the output, you’ll need to revise the du -a /
part to check different directories - it can depend on what applications you’re using but web server, database, or log file directories are probably good places to check.
Also, if you free up enough space (or you already have it installed), ncdu is also really helpful for viewing disk usage. With a command like ncdu -x /
, you can use arrow keys to move around the filesystem and view disk usage.
I had this issue for several days, here is how i fixed it:
du -a / | sort -nr | head -n 10
24252620 /var
22664740 /var/log
22032628 /var/log/mysqld.log
cat /dev/null > mysqld.log
Done.
Click below to sign up and get $100 of credit to try our products over 60 days!
This is crazy:
after a simple reboot: usage percentage goes to 2% from 100%. I don’t know why it’s behaving that way but DO needs to work on that issue.