Subject: Re: netbsd 2.0 no operating system
To: None <netbsd-users@netbsd.org>
From: None <oliverfuchs@onlinehome.de>
List: netbsd-users
Date: 04/09/2005 21:02:27
On Sat, 09 Apr 2005, Nenad Crnko wrote:

> On 04/08/2005 Oliver Fuchs wrote:
> > Sadly that it was not
> > working - a last thought: could it be that the mbr was writen wrong?
> 
> Well, assuming that the bootselector from wd0 offered an opportunity
> to boot from wd0, but you either hit F2 or let booting continue
> from wd1 after a timeout, the fact that you actually used to see
> "No operating system" message, would sugest that the booting progressed
> to the point of loading and executing the boot code from mbr on wd1.
> 
> The message text can only come from /usr/mdec/mbr, which is used by
> fdisk or sysinst to create the mbr. The other two candidates, mbr_bootsel
> and mbr_ext, do not contain the string, but instaed just print "3"
> if the same problem occours.
> 
> The mbr is formed by combining the code from /usr/mdec/mbr and injecting
> 4 * 16 bytes of partition information at offset 512 - (4 * 16 + 2).
> The last two bytes, 0x55 and 0xaa at offset 510, make the MBR_MAGIC,
> which is used by BIOS to speculate about presence of a bootable partition.
> 
> The source code making an mbr comes from here:
> ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-release-2-0/src/sys/arch/i386/stand/mbr/mbr.S
> 
> If I understand it correctly, the error message you mention is
> printed only if mbr code can not find MBR_MAGIC.

1) The disk wd1 is partitioned with FreeBSD sysinstall -> I am able to
install netbsd 1.6.1 (and later on the update to netbsd2.0)  and boot
into it without any problems (from bootselector on wd0 with F6 or from
the install cd with boot hd1a:netbsd)
2) Deleting the installed netbsd 1.6.1 system and partitioning the
wd1 disk with netbsd 2.0 sysinst I was not able to boot into netbsd
2.0 neither from installed bootselector on wd0 (it gives me the
message "no operating system" and then directly "press any key to
reboot") nor from the installation cd with boot hd1a:).

> 
> We have missed the opportunity to get the content from wd1 mbr when
> your system still failed to boot. It would have been useful to get it
> like so:
>   # dd if=/dev/wd1d of=/tmp/funny_mbr count=1
> or
>   # dd if=/dev/wd0d count=1 | hexdump -C

I tried it now (the first one) and it shows me besides others:

	Invalid partition table
	No operating system
	Error loading operating system

The next thing I was wondering about:
a) Installing netbsd (with sysinst) on wd1 
   with fdsik wd1 looks like this:
	[...]
	Partition table:
	0: NetBSD (sysid 169)
    	start 63, size 156301425 (76319 MB, Cyls 0-9729/81/1), Active
	1: <UNUSED>
	2: <UNUSED>
	3: <UNUSED>
b) Using FreeBSD sysinstall fdisk wd1 looks like this:
	Disk: /dev/rwd1d
	NetBSD disklabel disk geometry:
	cylinders: 155061, heads: 16, sectors/track: 
	63 (1008 sectors/cylinder)
	total sectors: 156301488
	BIOS disk geometry:
	cylinders: 1024, heads: 255, sectors/track: 
	63 (16065 sectors/cylinder)
	total sectors: 156296385
	Partition table:
	0: <UNUSED>
	1: <UNUSED>
	2: <UNUSED>
	3: NetBSD (sysid 169)
    	start 63, size 156301425 (76319 MB, Cyls 0-9729/81/1), Active

> It seems that for some reason the sector lost its MBR_MAGIC during
> or after installation. If there is a bug in sysinst and you would
> like to help tracking it down, you would probably have to repeat your
> ordeal a few times to find out and document how to reliably reproduce
> the problem.

But what I do not understand is that I was able to install netbsd
1.6.1 without problems when the disk wd1 was partitioned with FreeBSD
5.3 sysinstall.
Reproducing this error means to delete my up and running system again
... therfore I need some time.

Oliver
-- 
... don't touch the bang bang fruit