Subject: Re: mkfs 1.43 doesn't see all of my partitions
To: Dave Huang <khym@bga.com>
From: Bob Nestor <rnestor@metronet.com>
List: port-mac68k
Date: 07/23/1997 22:14:15
>Well, I've already gotten everything partitioned, and NetBSD's mostly
>reinstalled now (just have to tweak a couple of rc files and stuff). Your
>suggestion sounds like it'd work though... but why doesn't mkfs see the
>last partition?

There is a bug in some disk formatters that records the size of the 
Partition Map to be one block less than the number of blocks actually 
used. Apple HD Setup 7.3 does this as do some 3rd party formatters. Some 
disk formatters actually catch this error and offer to fix it.  I thought 
about doing the same in Mkfs but decided not to since Mkfs must re-write 
the Map entry blocks when a partition is changed from MacOS to BSD and 
vice versa.  If the Map block count was in fact correct and Mkfs went one 
block beyond this value it could wipe out the disk driver. (Some disk 
formatters allocate a fixed size Partition Map, others just allocate the 
minimum number of blocks to cover the Partitions being created.)

While testing Mkfs I actually did re-write the last unmapped block in the 
Partition Map which  happened to fall in the driver partition, and it's a 
bitch to fix if it occurs on the internal boot disk. This is because the 
Mac on boot loads the SCSI disk driver from the designated Startup disk 
before it checks to see where it needs to actually boot from.  The boot 
ROM will declare a machine error and throw up a Sad Mac if it can't load 
the SCSI disk driver from the designated startup volume if that volume 
exists on the SCSI chain.  This prevents the usual fix of starting from 
an emergency boot floppy which makes it difficult to recover from.  
NetBSD installation can be daunting enough for the newbie user, so I 
figured it would be best to avoid this problem by making Mkfs strictly 
follow the Partition Map definitions.

-bob