Subject: Re: NetBSD's swap partition ID
To: Zbigniew Baniewski <zb@ispid.com.pl>
From: Greg Troxel <gdt@ir.bbn.com>
List: netbsd-users
Date: 02/24/2006 08:41:23
Others have responded, but I'm sending a longer reply in case this
helps.

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
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.

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.

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
setup they will except for d (really the whole disk).  With other BIOS
partitions present, one can reference them ; see mbrlabel(8).

# /dev/rwd0d:
type: unknown
disk: foo
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 232581
total sectors: 234441648
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0		# microseconds
track-to-track seek: 0	# microseconds
drivedata: 0 

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:    525168        63     4.2BSD   1024  8192 43768  # (Cyl.      0*-    521*)
 b:   2621808    525231       swap                     # (Cyl.    521*-   3122*)
 c: 234441585        63     unused      0     0        # (Cyl.      0*- 232580)
 d: 234441648         0     unused      0     0        # (Cyl.      0 - 232580)
 e:  49152096   3147039     4.2BSD   2048 16384 28272  # (Cyl.   3122*-  51884*)
 f:   1049328  52299135     4.2BSD   1024  8192 43728  # (Cyl.  51884*-  52925*)
 g: 181093185  53348463     4.2BSD   2048 16384 28784  # (Cyl.  52925*- 232580)





-- 
        Greg Troxel <gdt@ir.bbn.com>