Subject: Re: More than you ever wanted to know about P4D-66s...
To: None <perry@piermont.com>
From: Bill Squier <groo@guinness.cs.stevens-tech.edu>
List: port-i386
Date: 08/14/1997 13:31:51
In message <199708141627.MAA22953@jekyll.piermont.com>, "Perry E. Metzger" writ
es:
>
>Bill Squier writes:
>> Now for the interesting part.  If I do the install "manually", I seem to
>> clobber the MBR after "installboot".  Below are the steps:
>
>Hmmm....
>
>Just for laughs, please try the following experiment:

Okay, I repeated my previous steps with your changes:

1) fdisk the disk so that it contains a 1 cyl non-netbsd partition.
   I didn't know the "sysid" for DOS, so I left it as "0".  I assume
   that it doesn't make any difference, we're just trying to get a 
   good "oc#" offset in the disktab.  Here's what I get from fdisk
   after that:

---
******* Working on device /dev/rwd0d *******
parameters extracted from in-core disklabel are:
cylinders=707 heads=32 sectors/track=63 (2016 sectors/cylinder)

parameters to be used for BIOS calculations are:
cylinders=707 heads=32 sectors/track=63 (2016 sectors/cylinder)

Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 0 is:
sysid 0 (unused)
    start 1, size 2014 (0 MB), flag 0
        beg: cylinder    0, head   0, sector  2
        end: cylinder    0, head  31, sector 62
The data for partition 1 is:
<UNUSED>
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
sysid 165 (NetBSD or 386BSD)
    start 2016, size 1421280 (693 MB), flag 80
        beg: cylinder    1, head   0, sector  1
        end: cylinder  705, head  31, sector 63
---

   I assume that I didn't get nailed by a fence-post error.  The way I read
   that is: ... oh, yeah I did.  "BIOS sector number stats with 1".  Hmm, well
   it should still be fine, I just have a 1 sector gap between partition 0
   and partition 3.  Or do I?  ``fdisk'' has some pretty confusing output.
   Does it mean "Hey, the BIOS numbers from 1, but I'm gonna show you
   everything from 0" _or_ "Hey, both the BIOS and I have agreed to make you
   input sector numbers based from 1" ??

   It looks like the former, since a start of 1, size of 2014 claims to
   occupy cyl 0, head 0, sector 2.  Ugh.


2) Installed the following disklabel (this time through the install script)

---
mywd|NetBSD installation generated:\
        :dt=ST506:ty=winchester:\
        :nc#707:ns#63:nt#32:\
        :se#512:\
        :pa#1171296:oa#2016:ta=4.2BSD:ba#8192:fa#1024:\
        :pb#249984:ob#1173312:tb=swap:\
        :pc#1421280:oc#2016:\
        :pd#1425312:od#0:
---

   Note the "oc#2016", which appears to be important! :-)  (Thanks Jonathan!)

3) ctrl-c'd the install script in the midst of the newfs, since I didn't want
   it to installboot without me.  Checked the fdisk output to ensure I still
   had the correct MBR.

4) Re-did the newfs of wd0a by hand.  No problem.

5) Did the "/usr/mdec/installboot /usr/mdec/biosboot.sym /dev/rwd0a" by
   hand.

6) Examined new fdisk output, still looks good:

---
******* Working on device /dev/rwd0d *******
parameters extracted from in-core disklabel are:
cylinders=707 heads=32 sectors/track=63 (2016 sectors/cylinder)

parameters to be used for BIOS calculations are:
cylinders=707 heads=32 sectors/track=63 (2016 sectors/cylinder)

Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 0 is:
sysid 0 (unused)
    start 1, size 2014 (0 MB), flag 0
        beg: cylinder    0, head   0, sector  2
        end: cylinder    0, head  31, sector 62
The data for partition 1 is:
<UNUSED>
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
sysid 165 (NetBSD or 386BSD)
    start 2016, size 1421280 (693 MB), flag 80
        beg: cylinder    1, head   0, sector  1
        end: cylinder  705, head  31, sector 63
---

7) Joy.  It successfully loads the bootblocks!


So the question is, what _EVIL_ is happening that prevents me from using the
entire disk as NetBSD?  If it's an LBA issue, why doesn't disabling it in the
BIOS help?  If it's a common problem, given the prevelance of LBA BIOSs out
there, why isn't the default behavior to reserve a small amount at the
beginning of the disk?

Related to that, what should be the SMALLEST offset I can use?  A single
sector?

BTW: I'm aware my BSD label is losing a cyl. at the end of the disk, I'll fix
that in my final label.


Thanks again for all your help.  Since the machine is still in a scratch state,
I'd be happy to run further experiments to satisfy curiosities.  (of anyone,
not just Perry).

-wps