Subject: Re: bootloader doesn't work from hd, works from cdrom
To: Oscar Fuentes <ofv@wanadoo.es>
From: David Laight <david@l8s.co.uk>
List: netbsd-help
Date: 01/16/2005 22:36:44
> This is the output of fdisk -v:
> 
> Disk: /dev/rwd0d
> NetBSD disklabel disk geometry:
> cylinders: 16383, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
> total sectors: 16514064
> 
> BIOS disk geometry:
> cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
> total sectors: 16514064
> 
> Partition table:
> 0: NetBSD (sysid 169)
>     bootmenu: NetBSD
>     start 63, size 16450497 (8032 MB, Cyls 0/1/1-1024), Active
>         beg: cylinder    0, head   1, sector  1
>         end: cylinder 1023, head 254, sector 63
> 1: <UNUSED>
> 2: <UNUSED>
> 3: <UNUSED>
> Bootselector enabled, timeout 5 seconds.

Hummm, there doesn't seem to be anything fishy there...

> What is the cure for this? Is it dangerous, in the sense that it
> could lead to crashes or data loss?

Unlikely

> OTOH, executing fdisk -B wd0 and choosing the third option ("Harddisk
> 0", being "NetBSD" the second and "The first active partition" the
> first) has this effect: the bootloader starts and prints the only
> option:
> 
> 1: NetBSD
> 
> the timeout expires and the bootloader prints again 1: NetBSD. If I
> press '1', NetBSD starts. How can I avoid having to press '1' for
> starting NetBSD?

The fact that the bootselect code works is odd - it uses the same
algorithm as the non-bootselect code.

It looks like you've configured the bootselect code to default to
booting disk 0 - which just re-executes the same bootstrap code as the
bios read in.

You can change the default with 'fdisk -B wb0', alternatively use
'fdisk -c mbr' to re-instate the non-interactive bootcode.

	David

-- 
David Laight: david@l8s.co.uk