df question

Hi,
Can anyone please explain a little about df command. I have following question:

Following example is showing % used as 4 where as total free blocks are 15.46 out of 16.00 MB blocks.

df -m /test
Filesystem MBblocks           Free         %Used         Iused           %Iused               Mounted on
/dev/lv11     16.00            15.46          4%             18                 1%                   /tmp/fger

What's the question?

Are you questioning because you suspect it should only show 3%?

0.54 used of 16 total, equals 3.375%

1 Like

This is the first time I'm working on AIX.
Please explain the calculation of %used in this example out of tatal available blocks?

'round up'

Amazing that you have exactly the same figures as in the man df page.
Help - AIX 6.1 Information Center

I think we need to see figures from a live system for df -k (if the numbers don't overflow) and df -m and to know what the mount command was for this filesystem. Chances are that it will be correct and that the man df example is wrong.

Mathematically the percentage used should be:

(((Size - Used) x 100) / Size)

However I have seen differences like this caused by error accumulation in Real Arithmetic. i.e. The program was not written to use sufficient precision.

Not on AIX but I have seen a version of "df" which used 1000 as the divisor not 1024 which was scary.

Footnote: Usually this question is because the free space percentage figure is too low! Usually because the account issuing the "df" was not root. This is one of the very few times where I have seen the free space percentage too high.