[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Incorrect behavior in df -P
From: |
Toby Murray |
Subject: |
Incorrect behavior in df -P |
Date: |
Sun, 25 Jun 2006 03:16:20 -0500 |
So I was hunting down a problem in cacti on a BSD server that didn't
happen on my linux cacti installation when I came across a difference
in the BSD and GNU versions of df and if I'm reading things correctly
I believe the GNU version is in error. Even comparing the actual
behavior to the man page seems to indicate a problem. So here is the
bug:
The -P option uses a block size of 1024 when it should be using 512
unless the block size is explicitly given. From the man page:
-P Output in six columns, with heading `Filesystem N-blocks Used
Available Capacity Mounted on' (with N=512, but N=1024 when the
-k option is given).
But when you run "df -P" the output says:
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/hda3 76069416 37835316 38234100 50% /
In BSD it correctly uses a 512 block size.
This is evidently a long-standing bug because cacti is using the -P
option but expects 1024 block size to be returned. When df is
"correct" this of course causes cacti to report twice the actual size
of the disks.
I noticed the problem on my gentoo linux box with version 5.94-r1 of
the "coreutils" package. I have also verified that the behavior is the
same on Ubuntu with version 5.93.
Thanks,
Toby Murray
- Incorrect behavior in df -P,
Toby Murray <=