[CentOS] du vs df size difference

Luciano Rocha strange at nsk.no-ip.org
Wed Sep 30 21:05:30 UTC 2009


On Wed, Sep 30, 2009 at 04:59:25PM -0400, Ryan Pugatch 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.

Do this:
mount /dev/xvda3 /mnt
du -hc /mnt

And see if you can find the other 12GB.

I usually do:
du -mc --max-depth 2 /mnt | sort -n

Though I've recently learned:
du -hc --max-depth 2 /mnt | sort --human-readable or some such, but that
requires a very recent coreutils installation.

-- 
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20090930/c2dc9186/attachment.sig>


More information about the CentOS mailing list