On Wed, Sep 30, 2009 at 2:59 PM, Ryan Pugatch rpug@tripadvisor.com wrote:
Hi all,
Curious issue.. looking in to how much disk space is being used on a machine (CentOS 5.3). When I compare the output of du vs df, I am seeing a 12GB difference with du saying 8G used and df saying 20G used.
# du -hcx / 8.0G total
# df -h / Filesystem Size Used Avail Use% Mounted on /dev/xvda3 22G 20G 637M 97% /
I recognize that in most cases du and df are not going to report the same but I am concerned about having a 12GB disparity. Does anyone have any thoughts about this or reason as to why there is a big difference? I have read a few articles online about it and none have really shown such a large difference.
One of the things I run into are either hidden files or leaked files where a process is still talking to a file but the directory no longer sees it so du doesn't catch it.
ls -l /proc/[0-9]*/fd/| grep delete
will show those up. Then its a matter if you want to keep that file around or not.
also du / did not look for files in / that were starting with a .
ls -la / and see if there are hidden directories or files taking up space.
Finally sparse files can give odd readings at time.. but that is the least likely reason.
Thanks
Ryan Pugatch Systems Administrator, TripAdvisor _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos