Subject: Restoring MBR smashed by disklabel?
To: None <port-i386@netbsd.org>
From: Peter Clark <ninjaz@webexpress.com>
List: port-i386
Date: 07/31/2000 17:55:48
Hi,

I've been doing some experimentation with Raidframe 
recently in NetBSD 1.5_ALPHA (second alpha).  When I 
change the disklabel on sd0 (the boot device), the 
system displays the "No Operating System" error message 
when rebooted.

I'm currently working around the issue by using the boot 
selector from the installation floppy:  boot sd0a:netbsd

When I installed NetBSD, I asked it to dedicate the 
entire disk to NetBSD and have a 400MB root partition.

What's the proper incantation of installboot/fdisk to 
get this working, and is it different depending whether 
the system was installed as dedicated entirely to NetBSD 
or using the "part of the disk" DOS partition mode?

Also, how does fdisk -B work according to the different 
disk layout methods (i.e., does selecting to use the 
whole disk at install time automatically just allocate a 
netbsd spanning the whole disk, or does it do 
"dangerously dedicated" mode such as FreeBSD?)



disklabel sd0 says:
<-- header snipped -->
a:   819957       63     4.2BSD     1024  8192    16   # 
(Cyl.    0*- 345)
c: 35843607       63     unused        0     0         # 
(Cyl.    0*- 15123*)
d: 35843670        0     unused        0     0         # 
(Cyl.    0 - 15123*)
e:  2459871   820020       RAID                        # 
(Cyl.  346 - 1383*)

fdisk sd0 says:

NetBSD disklabel disk geometry:
cylinders: 15110 heads: 6 sectors/track: 395 (2370 
sectors/cylinder)

BIOS disk geometry:
cylinders: 1023 heads: 255 sectors/track: 63 (16065 
sectors/cylinder)

Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: sysid 169 (NetBSD)
    start 63, size 35843607 (17501 MB), flag 0x80
        beg: cylinder    0, head   1, sector  1
        end: cylinder 1022, head 254, sector 63


Interstingly, apparently there are some bug reports 
proposing fixes to this:

http://mail-index.netbsd.org/netbsd-bugs/2000/03/09/0001
.html

and

http://mail-index.netbsd.org/netbsd-bugs/1997/09/05/0004
.html


                          -pete