Subject: change root device from raid0 to wd0a
To: None <netbsd-help@NetBSD.org>
From: James K. Lowden <jklowden@schemamania.org>
List: netbsd-help
Date: 06/18/2005 12:13:12
Yikes!

I seem to have made a serious error.  The kind that results in
nonbootedness.  It's trying to mount raid0 as the root partition, when it
should use wd0a.  

My good machine -- the broken one -- is an i386 with two ide drives,
each with three partitions, some redundant.  For normal operation, I use
these:

wd0a: / 
wd0e: /usr 
wd0f: raid0, /usr/local 
wd1f: raid0, /usr/local

I did not follow the Guide's advice to rebuild the kernel.

Note only the f partions participate in a raid0 mirror.  I boot
(or did) from wd0a, an ordinary FFS partition.

Last night I kicked the power switch by accident.  On rebooting, the
kernel messages indicate:

	boot device: raid0

It can't find init, and panics into the kernel debugger.  No amount
of "boot -s" works.

Fortunately, I have the 2.0 install kernel on (yet) another drive.
It let me fsck the drives.  (I didn't attempt anything with the f
partitions).  And I still have the old 1.6 kernel around.

I copied the kernel to wd2a, but "boot wd0a:netbsd.20 -s" yielded the same
result.  

A friend helped me by pointing out that "boot -a" prompts for the root
file system device.  That got me back up and running.  Hallelujah!

Two questions, please:

1.  Where does raidctl(8) store its information?  I'm guessing the boot
blocks, because that's where the kernel learns its root device.  

2.  How to set the root device back to wd0a?  It might be that I used
"raidctl -A root raid0" at some point (mistakenly).  Is "raidctl -A yes
raid0" sufficient?  

Btw, the configuration details:

$ raidctl -G raid0
# raidctl config file for /dev/rraid0d

START array
# numRow numCol numSpare
1 2 0

START disks
/dev/wd0f
/dev/wd1f

START layout
# sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_1
128 1 1 1

START queue
fifo 100

Many thanks.  I recommend normal shutdowns.  

--jkl