I have a simple linux machine running Amazon Linux AMI release 2012.09
However I am running out of space on my root mounted drive.
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.9G 7.6G 212M 98% /
tmpfs 3.7G 0 3.7G 0% /dev/shm
/dev/xvdh 100G 4.7G 96G 5% /data
The thing is /data is under / so it is counting that disk usage twice.
If I get the usage for just / it comes to 2.9G
Is there an easy way to stop this happening?
Thanks in advance.
Edit: Posted results
$ du -xcsh /
3.5G /
3.5G total
Seems to be right then?
df
looks at partitions, not the directory structure. Even if it did, it would show 107.9 G for/
. What makes you think that data is counted twice? How are you getting the usage just for/
?du
will measure/data
as well. Please post the output ofdu -xcsh /
. Thex
causesdu
to skip partitions mounted in subdirectories./
? It is weird that df and du -x do not agree.