Subject: Re: You can do AUX partitions on FWB 2.0.1
To: John P. Wittkoski <jpw@netscape.com>
From: Bob Nestor <rnestor@metronet.com>
List: port-mac68k
Date: 10/18/1996 17:48:46
John wrote:

>I received the following response when I emailed FWB
>regarding the rumors that the new Hard Disk Toolkit 2.0.1
>doesn't support AUX partitions, and thought it might
>be of interest to some of you.
>
>I haven't tried this, since I don't own FWB HDT yet. 
>I think that that "AUX" paritions are really the same as 
>the "Apple_UNIX_SVR2" partitions, right? Or is there some
>different between AUX 2.0 and AUX 3.0 partitions?

Well, I guess it's time for me to jump in and see if I can get a 
discussion going here and learn some things. Thanks for the lead-in John.

The disk partitioning process is really nothing more than dividing up the 
disk into segments and building the Partition Map which describes these 
segments.  Apple has defined the layout of the Partition Map which 
includes things such as the starting block number, block count, partition 
type and option partition name among other things.  The Partition Types 
are defined by Apple and most disk formatters follow the Apple 
definitions, but some don't. All MacOS partitions are of the "Apple_HFS" 
type, and all AU/X (and NetBSD) partitions are of the "Apple_UNIX_SVR2" 
type. It's the job of "mkfs" or "newfs" under NetBSD to lay out the 
blocks in the partition before it can be used for files just as the 
"Initialize" command does to MacOS partitions.

The "mkfs" application finds it's partitions by scanning the Partition 
Map for all "Apple_UNIX_SVR2" type partitions.  The Installer and NetBSD 
refine this by looking at the optional partition name field. If the 
partition is an "Apple_UNIX_SVR2" type with "swap" any place in the name, 
it's designated as a SWAP Partition under NetBSD. If the type is 
"Apple_UNIX_SVR2" and the name field contans the string "root", it's 
designated as a Root or a Usr Partition.  The boot partition (passed by 
the Booter?) is assigned slot "a", any additional partitions with "root" 
in the name are assigned to slots "g", "e", "f", and "h" in that order. 
(The Installer only goes to slot "g" - it appears to have an "off-by-one" 
error.) Slot "c" is always set up to cover the entire disk, and this is 
probably historical more than anything else. Slot "d" and any unfilled 
"e", "f", "g", or "h" slots are filled with information mapping to the 
non-"Apple_UNIX_SVR2" type partitions starting with the first partition 
above the Partition Map which is usually the Driver Partition. That's why 
slot "d" almost always shows up mapped to the "Apple_Driver" or 
"Apple_Driver43" Partition.

Since all the "magic" is driven off what is contained in the Partition 
Map, some of us have wondered if it wouldn't be possible to just re-write 
parts of the Partition Map. That way a user could use any disk 
formatter/disk partitioning software and define whatever partitions he 
(or she) desires. Make them all Apple_HFS partitions if that's what your 
formatter supports. Then teach "mkfs" to re-write the Partition Map 
blocks so the user can convert any disk Partition to a type required by 
NetBSD. With this approach we don't have to worry about AU/X or NetBSD 
partition support in the formatter.  Also we then have something to build 
on for the IDE disks which we'll probably want to support sometime to 
bring system like the Quadra 630 on-line.
 
Well, such a "beast" does now exist!  It's very (HIGHLY) experimental and 
should only be used by those with good backups and lots of moxy. It will 
ZAP any disk partition into a NetBSD type - even the MacOS one it's 
running from! ;-)  If anyone feels they fall into this bleeding edge, 
I'll try anything group,  and is willing to do some additional Beta 
testing, please drop me an E-Mail.  This new version of "mkfs" does work 
on my system, but that's no guarentee it will work anyplace else.  It 
also contains a number of bug fixes, or fixes to things I thought were 
bugs occuring on my system.

Thanks,
-bob