Subject: Re: Bootability eludes me once again
To: Anne Bennett <anne@alcor.concordia.ca>
From: Todd Vierling <tv@wasabisystems.com>
List: port-i386
Date: 05/09/2002 12:35:51
On Tue, 30 Apr 2002, Anne Bennett wrote:

: (a) I used "fdisk -iua" to put an MBR on sd0.  "fdisk sd0" reports:
:
: |  NetBSD disklabel disk geometry:
: |  cylinders: 4826 heads: 4 sectors/track: 107 (428 sectors/cylinder)
: |
: |  BIOS disk geometry:
: |  cylinders: 1023 heads: 255 sectors/track: 63 (16065 sectors/cylinder)
: |
: |  Partition table:
: |  0: <UNUSED>
: |  1: <UNUSED>
: |  2: <UNUSED>
: |  3: sysid 169 (NetBSD)
: |      start 64, size 64 (0 MB), flag 0x80
: |          beg: cylinder    0, head   1, sector  2
: |          end: cylinder    0, head   2, sector  2

Okay, so it's bootable, but realize that your partition starts one sector
"late" from a BIOS cylinder, AND, the size of this partition is nearly nil
(64 blocks).  Some BIOSes will not allow reading blocks beyond the end of
the partition, and it's pretty likely that /boot will reside beyond block 64
of that partition.  8-)

As a temporary thing, you could *try* leaving this at sector 64, but make
sure the size is at least 102720, as per:

: |    a:   102720       64     4.2BSD     1024  8192    16   # (Cyl.    0*- 240*)

Oh, and make sure LBA (not "DOS" or similar) is the large disk access mode
in the BIOS, if this simple tweak doesn't work.

I suggest starting the fdisk partition at absolute sector 63 (which should
come up as c/h/s 0/1/1, if you tell it not to explicitly specify start/end
addresses) and length equaling at least that of partition "a".  Since this
would mean moving partition "a"'s start by one sector, you'll pretty much
need to newfs and reinstall (or backup+restore) that partition.

: Size 16, offset zero is how I know that's my earlier attempt; I
: eventually settled on size 64, offset 64, as is reported by
: "fdisk sd0" or "fdisk sd0d".  What I don't understand is why this
: bogus and wrongly-placed MBR data was not overwritten by the
: subsequent disklabel and/or installboot commands.

Because it's using sd0a to find the start of the disk when doing "fdisk
sd0a" -- that MBR data, ignored by the BIOS (and NetBSD), is stashed not at
disk sector 0, but at the first sector of partition "a".  (This should
probably be failsafed to ensure that you're using the raw partition, but
advocates of flexibility wouldn't like it for some esoteric reasons.)

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi & NetBSD:  Run with it.
-- CDs, Integration, Embedding, Support -- http://www.wasabisystems.com/