Subject: Re: disklabel operations on /dev/rwd0c or /dev/rwd0d
To: Bruce Martin <brucem@cat.co.za>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: port-arm32
Date: 01/17/2000 10:50:45
On Mon, 17 Jan 2000, Bruce Martin wrote:

> Hi all,
> 
> I have written some C++ code that uses the disklabel() code. On the i386, I
> will successfully read disk labels, using the device as /dev/rwd0d (the
> whole wd0 disk, not a partition). However, my arm32 system reports
> "disklabel: rwd0d - device not configured." As soon as I change it to use
> /dev/rwd0c  it works, but this does not work on the i386 ("disklabel:
> rwd0c - device not configured"). Why do the arm32 and i386 use different
> partition names (arm32: rwd0c, i386: rwd0d) to indicate the whole disk? Is
> there any way I can change this so both use that same partition. I'm
> guessing maybe I labeled the disk incorrectly or something, but both
> disklabels look the same....

They do that because of history. Partition c was traditionally the "whole
disk" partition. But 386BSD (NetBSD's ancestor) used MBR disklabels, and
so made partiton c the whole UNIX partition, the MBR partition for 386BSD.
They then used d for the whole disk.

All other NetBSD ports use partition c.

Check out the opendisk(3) routine or the getrawpartition(3) routine. They
are in libutils, and are designed to help with this stuff.

Take care,

Bill