Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bootable disk: how?



On Thu, 17 Apr 2008, der Mouse wrote:
> Okay, I give up.  What does it take to make a disk bootable?

It can be very tricky.

Things to check:

* Verify that the BIOS attempts to boot from the correct disk.

* Verify that the MBR code from sector 0 of the disk actually runs.  (If
  you don't know, try using an MBR that prints a menu, such as NetBSD's
  mbr_bootsel; use NetBSD's fdisk to install and configure it.)

* Sector 0 of disk must contain working MBR code with a valid partition
  table.  Details may vary between MBR programs, but check these:
  - Exactly one "active" partition (MBRs that use menus migth not
    care).
  - Non-zero system type (a "correct" system type would be best; decimal
    169 for NetBSD; see "fdisk -l").
  - Correct offset to start of active partition (usually 63, but may vary
    based on disk geometry).
  - Correct C/H/S address for start of active partition (usually
    cyl=0/head=1/sector=1); depending on MBR code, this might be
    ignored, or it might be critical.  If it's critical then it depends
    on disk geometry as believed by some conspiracy between the BIOS,
    the disk controller, and the disk.  This might not match what you,
    NetBSD, or the sticker on the disk itself think the geometry should
    be.  If at all possible, save yourself from the C/H/S mess by using
    a BIOS that supports (and is configured to use) LBA addressing, and
    using MBR boot code that always uses LBA addressing.  (I notice that
    NetBSD's i386/mbr(8) man page fails to document which MBR flavours
    use LBA addressing.)

* Sector 0 of the partition must contain working PBR code.  In the case
  of NetBSD, this is installed by installboot(8).  I think it prints a
  message if it starts running, even if it then fails to proceed with
  the boot.

* There must be a valid NetBSD disklabel, somewhere in the first few
  sectors of the partition.  The size and offset for partition "c" in
  the disklabel should agree with the size and offset in the MBR.  The
  size for partition "d" in the disklabel should be the size of the
  entire disk, and the offset should be 0.

* The NetBSD file system that you are trying to boot must reside at the
  start of the MBR partition that you are trying to boot.  It doesn't
  have to be partition "a" in the disk label, but it does have to have
  an offset in the disklabel that matches both the offset of partition
  "c" in the disklabel and the related offset in the MBR pertition
  table.

> Most recently, I moved the disk to a 4.0 machine and used fdisk -aui
> and installboot there.  It *still* fails to find an OS.  (The exact
> message differs from system to system, depending on the BIOS; the 4.0
> machine says "DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER",
> while the 3.0 machine says "Operating System not found".  Of course, I
> have to either unplug other disks or disable booting from them, or the
> machine boots normally from wd0 (3.0) or sd0 (4.0).)

This sounds like a geometry problem.  See my suggestions about "LBA"
above.

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index