Cannot find out what consumes my disk space in AWS

0

I use a free tier ec2 instance in amazon aws. I run a nodejs server with mongodb, and the server has a memory and cpu intensive job.

df -h shows that I consumed 18G of 20G disk.

Filesystem      Size  Used Avail Use% Mounted on
udev            481M     0  481M   0% /dev
tmpfs            99M  788K   98M   1% /run
/dev/xvda1       20G   18G  1.7G  92% /
tmpfs           492M     0  492M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           492M     0  492M   0% /sys/fs/cgroup
/dev/loop3       18M   18M     0 100% /snap/amazon-ssm-agent/1335
tmpfs            99M     0   99M   0% /run/user/1000
/dev/loop5      2.0M  2.0M     0 100% /snap/serve/170
/dev/loop6       18M   18M     0 100% /snap/amazon-ssm-agent/1455
/dev/loop9       89M   89M     0 100% /snap/core/7396
/dev/loop7       55M   55M     0 100% /snap/core18/1098
/dev/loop1       90M   90M     0 100% /snap/core/7713
/dev/loop0       55M   55M     0 100% /snap/core18/1144

I tried to find out which files are reserving my disk, but I could not. I tried it using gt5, and I have some command line tricks like sudo du -sh /*. This gives me the following result:

15M     /bin
99M     /boot
0       /dev
6.4M    /etc
985M    /home
0       /initrd.img
0       /initrd.img.old
230M    /lib
4.0K    /lib64
16K     /lost+found
4.0K    /media
4.0K    /mnt
4.0K    /opt
du: cannot access '/proc/7424/task/7424/fd/4': No such file or directory
du: cannot access '/proc/7424/task/7424/fdinfo/4': No such file or directory
du: cannot access '/proc/7424/fd/3': No such file or directory
du: cannot access '/proc/7424/fdinfo/3': No such file or directory
0       /proc
88K     /root
788K    /run
15M     /sbin
993M    /snap
4.0K    /srv
0       /sys
47M     /tmp
2.7G    /usr
1.5G    /var
0       /vmlinuz
0       /vmlinuz.old

Now I am really confused about the situation.

Thanks in advance!

Horvath Adam

Posted 2019-09-20T07:38:29.803

Reputation: 1

4

Possible duplicate of deleting files but disk space is still full

– gronostaj – 2019-09-20T07:54:28.077

Here's a closely related question on our sister site dedicated for Unix questions

– gronostaj – 2019-09-20T07:58:22.067

Thank you, both answers were useful! – Horvath Adam – 2019-09-21T08:06:19.410

Install the program "ncdu" using your operating system's package manager. Ncdu lets you drill down into what is using disk space. – Tim – 2019-09-22T18:58:06.347

No answers