Subject: Re: bootloader doesn't work from hd, works from cdrom
To: None <netbsd-help@netbsd.org>
From: Oscar Fuentes <ofv@wanadoo.es>
List: netbsd-help
Date: 01/16/2005 22:46:19
David Laight <david@l8s.co.uk> writes:

> On Sun, Jan 16, 2005 at 06:34:21AM +0100, Oscar Fuentes wrote:
>> 
>> I'm a NetBSD newbie and just installed 2.0 on an old Pentium 133MHz
>> machine with a Fujitsu MPC3084AT hard disk (8.5 MB, 1027
>> cylinders). The installation uses just the first 1024 cylinders to
>> avoid potential problems with the BIOS.
>>
>> When booted from hd, the bootloader reports "Error L". However, if I
>> insert the NetBSD cdrom and boot from it (pressing a key before NetBSD
>> starts from the cdrom and typing "boot hd0a:netbsd") everything seems
>> to work fine.
>> 
>> How can I fix the hd bootloader?
>> 
>> Is this behavior an indication of some other problem with the hd?
>
> Error 'L' means that the boot code decided that it needed to do
> LBA reads, but that the bios doesn't support them (quite likely).
>
> The boot code requests the disk geometry from the bios, uses that to
> convert the CHS values for the partition start to an LBA address, and
> compares it to the LBA sector number in the label.  If they don't match
> it tries to do LBA reads...
>
> If your netbsd partition starts at the beginning of cylinder 0, head 1
> (which is where it normally ends up), then this should only happen if
> the number of sectors/track is wrong.  On modern bios this is almost
> always 63, but the old bios probably has several (variably useless)
> options (eg LBA, LARGE, AUTO) for disk translatios, which may result
> is a different sectors/track depending on the geometry the disk itself
> reports.
>
> I'd check that the bios geometry (eg reported by fdisk) matches the
> CHS and LBA values (fdisk -v) for the netbsd partition.

While installing, the installer correctly showed the geometry
specified on the BIOS setup and I aceppted it, but I created a
partition of the first 1024 cylinders.

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.

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

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?

Thanks David for your help.

-- 
Oscar