Subject: Re: Boot from USB key problem
To: Brad du Plessis <bradd@cat.co.za>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 01/14/2005 20:29:25
On Fri, Jan 14, 2005 at 05:10:35PM +0200, Brad du Plessis wrote:
> Hi,
> 
> I'm trying to boot a netbsd 2.0 kernel (i386) from a USB key and have had 
> no success.
> 
> The USB key I'm using is a Kingston 256Mb.

> disklabel sd0:

Irrelevant...
 
> fdisk sd0:
> Disk: /dev/rsd0d
> NetBSD disklabel disk geometry:
> cylinders: 246 heads: 64 sectors/track: 32 (2048 sectors/cylinder)
> 
> BIOS disk geometry:
> cylinders: 984 heads: 16 sectors/track: 32 (512 sectors/cylinder)
> 
> Partition table:
> 0: sysid 169 (NetBSD)
>    start 32, size 499680 (243 MB), flag 0x80
>        beg: cylinder    0, head   1, sector  1
>        end: cylinder  975, head  15, sector 32
> 1: <UNUSED>
> 2: <UNUSED>
> 3: <UNUSED>
 
... more irrelevant stuff deleted...
 
> On bootup the key seems to be accessed so I would assume that this is not a 
> BIOS problem. I get an "Invalid system disk" message.

The "Invalid system disk" message doesn't come from any NetBSD code.
It might come from the BIOS, but is more likely to come from the
boot code on the USB key itself - Like the code that is on 'non-boot'
floppy disks.

I suspect you have failed to install any boot code onto the first
sector of the 'disk'.  'fdisk -c /usr/mdec/mbr sd0' will probably
do it.

You may want to check what is there - 'hd -C -n512 /dev/sd0d' might
be illuminating.

	David

Oh - start sector of 32 is correct, all but the first sector of track 0,
head 0 is reserved (and not necessarily for bootcode).

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