Inconsistencies in df
Parv
parv at pair.com
Thu Dec 22 16:28:28 PST 2005
in message <7.0.0.16.0.20051222100521.01ed28d8 at smig.net>,
wrote Tim Lastine thusly...
>
> We are wondering why df gives such peculiar outputs on large disk
> drives? The used space and the available space do not add up the
> reported size of the partition. Is this a problem, or is it just the
> way it is? We are using a 250 Gig SATA (ad4) drive and a 1000 Gig
> SATA Raid 0(da0) drive
...
> canicula-a# df -h
> Filesystem Size Used Avail Capacity Mounted on
> /dev/ad4s1a 2.9G 55M 2.6G 2% /
...
> canicula-a# df
> Filesystem 1K-blocks Used Avail Capacity Mounted on
> /dev/ad4s1a 3049102 56150 2749024 2% /
...
> /dev/ad4s1f 64489864 4 59330672 0% /opt
> /dev/da0s1d 949613700 4 873644600 0% /raid
> /dev/ad4s1e 4058062 29730 2903688 22% /usr
> /dev/ad4s1d 3045006 302 2801104 0% /var
(Tabs were evil in the above case as df outputs were not lined up
correctly; i have readjusted the above.)
Try to take 8% reserve in account ...
df -t ufs \
| tail +2 \
| awk ' { sum = $3 + $4 + $2 * 0.08 ;
printf "%s: space diff: %f\n" , $1 , $2 - sum
}
'
... subject to rounding errors. Here is an example ...
# df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ad0s2a 138606 51952 75566 41% /
devfs 1 1 0 100% /dev
/dev/ad0s2d 594926 417042 130290 76% /usr
/dev/ad0s2e 475886 95826 341990 22% /var
/dev/ad0s2g 16724102 11949534 3436640 78% /misc
/dev/ad0s2f 2875822 16170 2629588 1% /work
procfs 4 4 0 100% /proc
# df -t ufs | tail +2 | awk '{ ... }' # awk program is given above
/dev/ad0s2a: space diff: -0.480000
/dev/ad0s2d: space diff: -0.080000
/dev/ad0s2e: space diff: -0.880000
/dev/ad0s2g: space diff: -0.160000
/dev/ad0s2f: space diff: -1.760000
- Parv
--
More information about the freebsd-questions
mailing list