7

I am confused. Our EC2 instance is showing that the disk is 98% full. The output from df -Th shows:

Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/xvda1    ext4    7.9G  7.7G  172M  98% /

But if I run ncdu to see where the space has gone it shows that only 1.4gb is used:

 742.4MiB [##########] /usr
 505.1MiB [######    ] /var
  75.3MiB [#         ] /lib
  55.3MiB [          ] /opt
  31.8MiB [          ] /boot
  21.2MiB [          ] /lib64
  18.8MiB [          ] /etc
  11.4MiB [          ] /sbin

Doing a search for large files throws nothing up either.

I am confused as to where the other 5gb has gone and really need to recover it as the server is dangerously low on space.

Any idea where the space has gone and how I can recover it?

williamsdb
  • 483
  • 1
  • 7
  • 17

2 Answers2

3

The link provided by Iain in the comments and repeated below sort out the issue:

Ubuntu server: hard drive always full

williamsdb
  • 483
  • 1
  • 7
  • 17
  • This answer may also help https://serverfault.com/questions/229454/after-deleting-a-large-file-how-long-does-it-take-df-to-pick-up-the-change/229456 – Alliswell Oct 07 '19 at 16:35
0

Turns out the problem for me was docker. Check this link for the solution: https://askubuntu.com/questions/413358/disk-is-full-but-cannot-find-big-files-or-folders

You can remove docker images with docker rmi $(docker images -a -q)

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296