Subject: Re: NetBSD's swap partition ID
To: Greg Troxel <gdt@ir.bbn.com>
From: John Nemeth <jnemeth@victoria.tc.ca>
List: netbsd-users
Date: 02/24/2006 13:18:45
On Jul 17,  3:17am, Greg Troxel wrote:
}
} NetBSD can operate without an MBR partition table, having just a BSD
} disklabel.  But this can confuse other systems, and I was unable to
} use grub for booting with this setup.  While there's a certain

     In this scenario, there is no point in using GRUB since there can
only be one operating system on the machine.

} traditional cleanliness to using only a BSD disklabel (just like you
} would on a PDP-11 under 2.8BSD), my opinion is that on an i386 one
} should use the fdisk partition table to make life easier.

     If you hand install your systems, then it is just as easy to do
it without an MBR.  But, if you sysinst, then you might as well let
it do it the way it wants.

} Assuming you have an IDE disk
} 
} $ fdisk wd0 
} 
} show the i386 BIOS partition table.  typically first 63 are reserved,
} and 63-end are in one partition, labeled 0xA9 or 169. which is NetBSD.

     Actually there is nothing that says the first 63 sectors should be
reserved.  Traditionally, partitions start on track boundaries.  This
meant that the first track on the disk typically didn't get used for
anything except the MBR.  Under the CHS scheme, the maximum sector
number is 63.  Modern drives fake their geometry to get the maximum CHS
size, which is 8 GB, so track length is almost always 63 sectors.
Going beyond 8 GB requires using LBA mode.

     However, if you're operating system can handle doing partitions on
non-track boundaries then there is no reason to reserve the first track
for the MBR, except tradition and old tools.  Given that disks have
used a fake geometry for a very long time, there really isn't a very
good reason for it now, other then easing block number to CHS
translation.  In the past, there might have been some argument about
performance.  However, on modern drives the CHS value has nothing to do
with the physical sector number, so operating systems don't know where
the physical track boundaries are anyways.  Heck, the number of sectors
per track varies with what cylinder the track is in, so you can't use a
simple formula to translate.  Not to mention, on modern drives you use
the block number (i.e. LBA addressing) to find sectors not the CHS
value anyways, so the CHS value really doesn't matter.  In other words,
all this stuff about the way disks are partitioned on PCs is just
prehistoric baggage.

} On my machine:
} 
} Partition table:
} 0: NetBSD (sysid 169)
}     start 63, size 234441585 (114473 MB, Cyls 0-14593/81/1), Active
} 1: <UNUSED>
} 2: <UNUSED>
} 3: <UNUSED>
} 
} $ disklabel wd0
} 
} shows the NetBSD disklabel which has wd0a, wd0b.  It is not neceessary
} that these all lie within the BIOS partition, but with the above fdisk

     True, however if they didn't, a different operating system may
come along and stomp on them, since they would be located in what
appears to be unused disk space.

}-- End of excerpt from Greg Troxel