Subject: Re: Adding new disk; partitions not empty
To: Christopher P. Gill <cpg@scs.howard.edu>
From: Chris Brown <chrsbrwn@mindspring.com>
List: port-mac68k
Date: 06/28/1999 09:19:05
On Mon, 28 Jun 1999 04:21:57 -0400 (EDT) cpg@scs.howard.edu (Christopher P.
Gill) wrote:

>Greetings, all.
>
>I've been following the discussion about adding a disk, and have recently
>added a second NetBSD disk in my Quadra 800 (hitherto 40/500, GENERIC
>kernel).  Unfortunately, I think something has gone awry, and I'd like
>some help.  Essentially, my brand-new partitions are mountable, but don't
>appear to be empty, appearing progressively more full in order of their
>creation/indexing.  A full (i.e., very long) description follows.
>

<<<<<<<<<snip>>>>>>>>>>>

>
>==>
>
># df -k /bkproot /pkg /tmp2 /home2 /work
>
>Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
>/dev/sd1a       39870        9    35874     0%    /bkproot
>/dev/sd1f      436691   237689   155332    60%    /pkg
>/dev/sd1e      237680   157383    56529    73%    /tmp2
>/dev/sd1h      514351   436700    26215    94%    /home2
>/dev/sd1g      157374    79749    61887    56%    /work
>

As I'm sure somebody else will say as well, this is a (rather old and
longstanding) bug. df reports the size/used of each partition (except the
first) as that of the current partition plus the previous partition in the
partition table. 

I just wrote a perl (and python, too, as I am teaching myself both languages)
wrapper that takes the columns apart, subtracts out the excess, redoes the
Avail and Capacity calculations, and then prints out the results in the
original format. 

It's a dirty hack, but you are welcome to it if you would like to customize it
to your system (at the very least, you would have to change the device names
and reorder the calculations, as my system starts over with the addition at
one partition, just to be different). The python one is actually much prettier
and easier to understand, so if you know any python that might be the best to
customize :)

--
Chris Brown -- Macintosh networking/Web development
<chrsbrwn@mindspring.com> <http://www.mindspring.com/~chrsbrwn>