Subject: Re: RAIDframe bootblocks partition choice admonition in NetBSD guide?
To: Greg Troxel <gdt@ir.bbn.com>
From: David Laight <david@l8s.co.uk>
List: netbsd-help
Date: 02/07/2006 08:06:54
On Mon, Feb 06, 2006 at 08:47:01PM -0500, Greg Troxel wrote:
> 
> In the guide, one is told to use wd1a and not wd1d:
> 
>         Caution
> 
>         Although it may seem logical to install the 1st stage boot block into
>         /dev/rwd1{c,d} (which is historically correct with NetBSD 1.6.x
>         installboot(8) , this is no longer the case. If you make this mistake,
>         the boot sector will become irrecoverably damaged and you will need to
>         start the process over again.

That information could be wrong, indeed it doesn't make sense to me either!
Installboot must write to the beginning of the mbr partition, otherwise
the boot sequence will fail to find the code. /boot must be copied into
the file system that starts at the same location (or + 64 sectors), or
to the 'a' partition described by the label read from that specific mbr
partition.  (Usually the label is writen to the start of all type 169 ptns.)

> On i386, install the boot loader into /dev/rwd1a :
> 
> # /usr/sbin/installboot -o timeout=30 -v /dev/rwd1a
>   /usr/mdec/bootxx_ffsv1
> File system:         /dev/rwd1a
> File system type:    raw (blocksize 8192, needswap 1)
> Primary bootstrap:   /usr/mdec/bootxx_ffsv1
> Preserving 51 (0x33) bytes of the BPB
> 
> 
> I did this on wd1, but haven't yet on wd0.  Given that installboot
> seems to write the beginning of the filesystem, I don't see why it
> cares what the end is, and why wd1a matters vs wd1d.
> 
> In my case, it seems one gives the RAID component, so the boot blocks
> fit in blocks 1 and 2-15 after block 0/MBR of the RAID label.  So I'm
> particularly baffled as to why choosing wd1d and wd1a should lead to
> different results.

You mean block 0 and 2-15, it overwrites block 0 (in your case replacing
the mbr code with (what is normally) the pbr code), skips the label and
then writes the rest of its (max) 8k.

There is space in the RAID for this code...

	David

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