Subject: How to install bootstrap for RAID 1 on i386-current?
To: None <current-users@netbsd.org>
From: Tom Ivar Helbekkmo <tih@eunetnorge.no>
List: current-users
Date: 09/19/2003 11:36:08
I'm trying to get my NetBSD/i386-current (1.6ZA) system to boot from a
RAID 1 root file system, but I'm having no luck getting fdisk and
installboot to do what I want...  :-(

I understand that the primary bootstrap is able to locate /boot on a
RAID 1 set in partition xx0a, because it checks for the extra 64 block
offset to the actual file system.  I'm also reserving space at the
start of the disk for the BIOS and bootstrap to use.  I've read that
at least a whole track must be set aside, so after looking at my
various disks, I figured 512 sectors would be plenty for any disk.

Thus, I have an sd0 and sd1 pair that both look like this:

 a:   4718656       512       RAID                     #
 c:        15         0     unused      0     0        #
 d:  17916240         0     unused      0     0        #
 e:   2578248   4719168       RAID                     #
 f:  10485824   7297416       RAID                     #
 h:    524288       576     4.2BSD      0     0     0  #

The three RAID partitions are for raid0, raid1 and raid2, to be used
for root and var, swap, and usr, respectively.  Partition 'h' is just
a way to get at the actual root file system from the outside.  'c'
"just happened" when I ran installboot:

# installboot -v -t raw /dev/rsd0d /usr/mdec/bootxx_ffsv2
File system:         /dev/rsd0d
File system type:    raw (blocksize 8192, needswap 0)
Primary bootstrap:   /usr/mdec/bootxx_ffsv2

This caused the fdisk setup to change from "nothing" to:

3: NetBSD (sysid 169)
    start 0, size 15 (0 MB, Cyls 0-1), Active

Looking back at this now, I can see that there's nothing here to tell
the bootstrap where the NetBSD disk label is, so there's no way it can
get started anyway.  :-)  Trying to boot it causes my computer to
blank the screen and type "PRESS ANY KEY TO REBOOT".

So, I tried to install on /dev/rsd0h instead (after adjusting my sd0c
partition (and fdisk NetBSD partition) to be 512-$):

# installboot -v /dev/rsd0h /usr/mdec/bootxx_ffsv2
File system:         /dev/rsd0h
File system type:    ffs (blocksize 8192, needswap 0)
Primary bootstrap:   /usr/mdec/bootxx_ffsv2

That zapped the disk label on my raid0, so I fixed that, and tried to
boot the disk.  After a little while, it said "Error 3".

I'm stuck, here.  :-(  Can someone tell me how to get a bootstrap onto
this disk, that will cause the primary bootstrap to actually pick up
the /boot that's in my raid0a?  Here's what I've got now:

# fdisk sd0
[...]
3: NetBSD (sysid 169)
    start 512, size 17915728 (8748 MB, Cyls 34/0/3-1194416), Active
[...]
# disklabel sd0
[...]
 a:   4718656       512       RAID                     #
 c:  17915728       512     unused      0     0        #
 d:  17916240         0     unused      0     0        #
 e:   2578248   4719168       RAID                     #
 f:  10485824   7297416       RAID                     #
 h:    524288       576     4.2BSD      0     0     0  #
# disklabel raid0
[...]
 a:    524288         0     4.2BSD   1024  8192 46376  #
 c:        15         0     unused      0     0        #
 d:   4718592         0     unused      0     0        #
 e:   4194304    524288     4.2BSD   2048 16384 28624  #
# disklabel raid1
[...]
 b:   2577664       512       swap                     #
 d:   2578176         0     unused      0     0        #
# disklabel raid2
[...]
 d:  10485760         0     unused      0     0        #
 e:  10485760         0     4.2BSD   2048 16384 28624  #
# df -h
Filesystem    Size     Used     Avail Capacity  Mounted on
/dev/raid0a   247M      27M      208M    11%    /
/dev/raid0e   2.0G     182M      1.7G     9%    /var
/dev/raid2e   4.9G     3.1G      1.6G    66%    /usr

Any help anyone can offer will be greatly appreciated!

-tih
-- 
Tom Ivar Helbekkmo, Senior System Administrator, EUnet Norway
www.eunet.no  T: +47-22092958 M: +47-93013940 F: +47-22092901