Subject: Re: RAID1 bootblocks for 2.0
To: None <port-sparc64@NetBSD.org>
From: Geoff Adams <gadams@avernus.com>
List: port-sparc64
Date: 03/30/2005 16:36:15
OK. So, I'm picking up on a thread from several months ago. But I just 
ran into this problem (in -current as of a couple weeks ago), and since 
I didn't see a definitive solution given, I thought I'd give mine.

On 12 Dec 2004, at 7:47 AM, Martin Husemann wrote:

> On Sat, Dec 11, 2004 at 05:07:40PM +0000, Jonathan Perkin wrote:
>>   Boot device: /pci@1f,0/ide@d/disk@0,0  File and args: netbsd
>>   NetBSD IEEE 1275 Bootblock
>>   .Inode not directory
>
> Did you have a non-raid partition there previously? Maybe the bootblk 
> finds
> the old supberlock magic and accepts it (yes, this is a bug). The 
> disklabel
> on wd0 says "RAID" as partition type?

This was enough of a hint to fix it for me. I did this:

$ dd if=/dev/rsd1c of=/tmp/label count=1
$ dd if=/dev/zero of=/dev/rsd1c bs=512 count=64
$ dd if=/tmp/label of=/dev/rsd1c count=1
$ /usr/sbin/installboot -v /dev/rsd1a /usr/mdec/bootblk
File system:         /dev/rsd1a
File system type:    raw (blocksize 8192, needswap 0)
Primary bootstrap:   /usr/mdec/bootblk
Bootstrap start sector: 1
Bootstrap byte count:   4915
Writing bootstrap

That cured the ".Inode not directory" problem, and it proceeded to 
boot. But the RAID set didn't autoconfigure anymore, so it couldn't 
mount root. In fact, the RAID set wouldn't configure at all, so I had 
to go back and re-create it:

$ raidctl -C /etc/raid0.conf raid0
$ raidctl -I 3475834 raid0
$ raidctl -A root raid0

When I re-created the RAID set, the disklabel within the RAID set was 
still intact, as were all the partitions.

I suspect all of this was caused by not heeding the warning in the 
Guide *not* to install the boot blocks into /dev/rsd1c. Apparently in 
-current (and I guess in 2.0), there's a real difference. Use 
/dev/rsd1a (or equivalent). The Guide said that I'd have to start over. 
Luckily, I didn't; this shortcut worked.

- Geoff