Subject: Re: [Q] `df` command is bugged ?
To: Gwenole Beauchesne <gwenole.beauchesne@iname.com>
From: Colin Wood <cwood@ichips.intel.com>
List: port-mac68k
Date: 03/19/1998 13:24:34
Gwenole Beauchesne wrote:
> Hi,
> 
> I have noticed a strange phenomenon. As I issue a `df -k` command, I get
> the following output for my /usr partition for example:
> 
> File System  1K-blocks  Used   Available  Capacity  Mounted
> /dev/sd0g     290214   186558   74634       71%      /usr
> 
> *But* the `du -ks /usr` tells me that only 89,886K are used !! The most
> striking fact is that my /home partition is nearly-empty (only 12K!) but
> the df command reports that 290,226K are used!!
> 
> How can I solve this problem ?
> Note: I formatting stage (with MkFS), I chose to optimize for speed
> since that was the recommended option in the Jaz Mini How-to and that
> Jaz and SyJet drives are pretty similar...

This is a known bug (well, I don't know if there is a PR on it or not).
Since you have data on it, please file a PR via send-pr or using the web
interface.  I've looked at the code in disksubr.c in the kernel as well as
stuff like the disklabel and df code, but I can't figure out where the
problem is coming from, exactly.  This has come up before, but no one has
had a decent answer, either.  I think that it might be a result of having
a partition at 'g' and then the next one at 'd' (or 'e').  I think that
this might confuse some of the disk routines.  It appears that the
partitions reported by 'df' have the cumulative usages (and sizes) rather
than their real sizes.

Later.

-- 
Colin Wood                                 cwood@ichips.intel.com
Component Design Engineer - MD6                 Intel Corporation
-----------------------------------------------------------------
I speak only on my own behalf, not for my employer.