Subject: More than you ever wanted to know about P4D-66s...
To: Bill Squier <groo@guinness.cs.stevens-tech.edu>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-i386
Date: 08/14/1997 09:57:00
On Thu, 14 Aug 1997 11:55:17 -0400,n
  Bill Squier <groo@guinness.cs.stevens-tech.edu> writes:


> 2) Install the following disklabel (with "disklabel -w -r wd0a mywd")
> 
> ---
> mywd|NetBSD installation generated:\
>         :dt=ST506:ty=winchester:\
>         :nc#707:ns#63:nt#32:\
>         :se#512:\
>         :pa#1171296:oa#0:ta=4.2BSD:ba#8192:fa#1024:\
>         :pb#254016:ob#1171296:tb=swap:\
>         :pc#1425312:oc#0:\
>         :pd#1425312:od#0:
> ---
> 
>    ``disklabel'' asks "Erase the previous contents of the disk?"
>    I answer "y".

IIRC, this *always* means disklabel overwrote your MBR at that point,
writing an MBR set up to use the entire disk for NetBSD.  I'm starting
to think disklabel should never ever do that, or should at least
produce a more informative message.

Since pc and pd are identical (and neither leaves space for the MBR)
you probably just lost.  That's consistent with seeing that the output
in step #6 is different from step #1.


Disklabel tries to implement two choices.
  1)  you can label your entire disk for NetbSD, in which case
      the BSD disklabel effectively goes into the MBR and succeeding blocks.
  2)  You can write a disklabel into the beginning of your MBR slice
      dedicated to BSD (your BSD `C' partition.)

AFAIK, the `erase whole disk' message from disklabel *always* means
that it's decided you want to do #1, and that it's about to stomp over
your MBR.  (see line 435 ff. of disklabel.c.)


Why you don't see any change until after the installboot is beyond me.
Maybe it's an inconsistency between the incore and ondisk partition tables?

Anyway, UTSLing, you need to set up your C partition
entry to start at the __exact same place__ as your MBR slice for
NetBSD, or disklabel is always going to do #1.

In the bugreport you sent, I think that  means setting oc#2.

If it were up to me, I'd eliminate all support for `dedicated' disks
(#1), except on removable media. It only saves 8K bytes and it seems
to cause more trouble than it's worth.