AIX 6.1 – df and du output does not match

I encountered this weird issue where the output from df -g and du -g does not match at all. I managed to find out the main reason for this.

# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/fslv00 182.00 37.31 80% 22953 1% /u01
#du -g
17.44 .
17gb of usage vs 140gb of usage. That's a huge difference in the storage usage here!

So what is the problem here?

du -g

du traverses the file tree, adding up the number of blocks allocated to each
directory, symlink, and file as reported by the stat() system call. This is how
du arrives at its total value.

df -g

df looks at the file system disk block allocation maps to arrive at its total
and free values.

Disk blocks get assigned when a process is started and it will hold the disk block. It might use additional disk blocks for meta data. This additional disk blocks will get tracked by df-g but not du -g. Thus, df command will usually report high storage usage as compared to du. However, if the disk blocks got locked by a process and you use another application to delete the disk blocks, du will reflect the change but df will not.

For more information, please look it up over here


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s