Question

DISK SPACE ACCIDENTALY CONSUMED? dev\vda1 100% used

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

Subscribe
Share

This is crazy:

[root@tt /]# du -cha --max-depth=1 / | grep -E "M|G"
du: cannot access ‘/proc/1858/task/1858/fd/4’: No such file or directory
du: cannot access ‘/proc/1858/task/1858/fdinfo/4’: No such file or directory
du: cannot access ‘/proc/1858/fd/4’: No such file or directory
du: cannot access ‘/proc/1858/fdinfo/4’: No such file or directory
273M	/run
37M	/etc
150M	/root
2.0G	/var
1.5G	/usr
243M	/boot
1.8G	/home
41M	/opt
234M	/backup
6.1G	/
6.1G	total
[root@tt /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       300G  300G   20K 100% /
devtmpfs        7.8G     0  7.8G   0% /dev
tmpfs           7.8G  4.0K  7.8G   1% /dev/shm
tmpfs           7.8G  273M  7.5G   4% /run
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
tmpfs           1.6G     0  1.6G   0% /run/user/1002
tmpfs           1.6G     0  1.6G   0% /run/user/

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.

[root@tt ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       300G  6.0G  295G   2% /
devtmpfs        7.8G     0  7.8G   0% /dev
tmpfs           7.8G  4.0K  7.8G   1% /dev/shm
tmpfs           7.8G   17M  7.8G   1% /run
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
tmpfs           1.6G     0  1.6G   0% /run/user/0


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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:

  1. Login to “Terminal” in digitalocean
  2. Write command to see which directorh is eating disk space du -a / | sort -nr | head -n 10
  3. In my case it was MySQL log files:
24252620        /var
22664740        /var/log
22032628        /var/log/mysqld.log
  1. Write command to empty log files
cat /dev/null > mysqld.log

Done.