0

I have an AWS linux instance with a root drive of 32GB.
I have an EBS mount of 20GB

On my root I ran out of space, so I cleared out some files. However my root drive is still full. I can't find out why because when I look at sizes of the directories using du and ncdu they show the drive should have a lot of space.

df 

I get the following results

Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 32894812 31946092 848472 98% / devtmpfs 2017224 60 2017164 1% /dev tmpfs 2025364 0 2025364 0% /dev/shm /dev/xvdh 20511356 4459276 15003504 23% /mnt/ebs 

My /dev/xvda1 is still full

After some research I installed a great tool ncdu to display disk space and the results are:

ncdu 1.10 ~ Use the arrow keys to navigate, press ? for help --- / ------------------------------------- 4.2GiB [##########] /mnt 1.5GiB [### ] /var 1.2GiB [## ] /usr 684.9MiB [# ] /opt 464.3MiB [# ] /home 141.7MiB [ ] /lib 53.5MiB [ ] /boot 21.2MiB [ ] /lib64 10.8MiB [ ] /sbin 8.1MiB [ ] /bin 7.1MiB [ ] /etc 2.7MiB [ ] /tmp 60.0KiB [ ] /dev 48.0KiB [ ] /root e 16.0KiB [ ] /lost+found e 4.0KiB [ ] /srv e 4.0KiB [ ] /selinux e 4.0KiB [ ] /media e 4.0KiB [ ] /local . 0.0 B [ ] /proc 0.0 B [ ] /sys 0.0 B [ ] .autofsck 

If I du -h my total is 8.3G /

So why would my disk be 95% full when it clearly has a lot of space. Am I missing something to do with the mounts and is there any other tool I can run to find out why it is 95% full?

1 Answer 1

4

What did you delete? If you remove a file that is still in use by a running process (e.g., a daemon), that disk space is only released when the process is shut down/restarted.

For example, if you removed current Apache log files, the space will still be in use until you restart Apache. Similarly for system logs (those in /var/log).

You can either:

  • Restart the process(es) in question (e.g. Apache, syslogd, etc).
  • Restart your system.

Once you do one of the above, you should see more available space.

1
  • You are right. After restarting a process that I know I removed some files from the used space has gone to 16% /dev/xvda1 32894812 5133296 27661268 16% / I can see how my process went wrong. I changed the home location of a build server to a different mount and restarted the build server and once I confirmed it was running correctly I deleted the old directory. There must have still been a lock on that directory as the logs still get written there. Commented Jul 26, 2015 at 11:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.