Author |
Message
|
crossland |
Posted: Fri Jul 29, 2005 2:39 am Post subject: Different df and du values for log file system |
|
|
Master
Joined: 26 Jun 2001 Posts: 248
|
My client is getting two different values for the amount of space being used for the MQ log filesystem, depending upon whether they use the df or du command.
As I understand it, df is based on information from statvfs while du actually adds the space used by all the files it finds.
They are using linear logging and have a script to remove unwanted log files. The difference between the output from the 2 commands is considerable.
Has anyone seen this happen before?
Thanks,
Tim |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jul 29, 2005 3:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Are they sure they aren't looking at one number in KB and another number in MB, or similar?
Also, define "considerable"... how much difference? Is the difference explainable by block allocation vs. byte count? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
crossland |
Posted: Fri Jul 29, 2005 5:52 am Post subject: |
|
|
Master
Joined: 26 Jun 2001 Posts: 248
|
As the -k flag is being used on both commands, the output should be in units of 1024 bytes in both cases.
du -k shows 1471457 for /var/mqm/log
while the used column of df -k shows 6815129 for the same file system.
Regards,
Tim |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jul 29, 2005 6:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Are they running du as mqm or root - a user that has full permissions on all files underneath /var/mqm/log? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 29, 2005 11:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Depending on the flavor and the way the file system is created there are some inherent differences between df and du.
1) assumption is that the user will have full permissions to the file system so that no authorization problems skews the data.
Unix file systems are defined by a number of nodes or possible descriptors. You will see something about it with the df commande:
Quote: |
Iused %Iused
4380 2% |
Now each node has a number of allocated bytes.
Files may span multiple nodes but not fully occupy a single node.
Thus true usage in MB or kB does not reflect node usage.
How ever for free space calculation the free nodes are used....
What does this mean? The more your file system is fragmented ... the less free space you have even though the total amount of bytes in the files does nowhere amount to the calculation (Total space - Free space).
Enjoy  |
|
Back to top |
|
 |
csmith28 |
Posted: Fri Jul 29, 2005 5:04 pm Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
crossland wrote: |
As the -k flag is being used on both commands, the output should be in units of 1024 bytes in both cases.
du -k shows 1471457 for /var/mqm/log
while the used column of df -k shows 6815129 for the same file system.
Regards,
Tim |
I have seen this before and it usually indicates that someone deleted a file that was actively being written to when it was deleted so the Inodes have been orphaned and the statvfs is not being updated.
In older versions of AIX a reboot of the server was needed to restore normal behavior but now if you can, and this part gets tricky, devine what process was doing the write to the file that was deleted and restart it the the df command will start to function as expected.
Under the circumstances since the Filesystem is /var/mqm/errors I suspect that someone may have deleted a *.FDC file while it was being written too. Unfortunately this may require you to stop and restart the MQManager involved. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial. |
|
Back to top |
|
 |
|