Subject: Re: raidframe recovery
To: Patrick Welche <prlw1@newn.cam.ac.uk>
From: Greg Oster <oster@cs.usask.ca>
List: netbsd-users
Date: 10/04/2004 14:00:12
Patrick Welche writes:
> On Mon, Oct 04, 2004 at 01:38:42PM -0600, Greg Oster wrote:
> > Oh...... This is 2.0E from May 5, and support for 'absent' didn't 
> > happen until May 22, 2004. 
> 
> Our emails must have crossed :-)

Yes :)

> > If you go back to your original /etc/raid0.conf with wd1a, and make 
> > sure wd1a (as a physical component) doesn't exist, then 'raidctl -C' 
> > should configure the set for you.  When you do 'raidctl -s', you
> > should see wd1a listed, but marked as failed.  (you need to make sure 
> > wd1a doesn't exist, as otherwise it will be considered the 'master' 
> > here, and you'll end up reading from it instead of from wd2a!)
> 
> Much happier :-)
> 
> # raidctl -s raid0
> Components:
>            /dev/wd1a: failed
>            /dev/wd2a: optimal
> No spares.
> /dev/wd1a status is: failed.  Skipping label.
> Component label for /dev/wd2a:
>    Row: 0, Column: 1, Num Rows: 1, Num Columns: 2
>    Version: 2, Serial Number: 35710, Mod Counter: 273
>    Clean: No, Status: 0
>    sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
>    Queue size: 100, blocksize: 512, numBlocks: 490234624
>    RAID Level: 1
>    Autoconfig: No
>    Root partition: No
>    Last configured as: raid0
> Parity status: DIRTY
> Reconstruction is 100% complete.
> Parity Re-write is 100% complete.
> Copyback is 100% complete.
> 
> 
> 
> 
> Now to make a backup ;)

:)  And the other thing you really really really want to do is:

 raidctl -A yes raid0

so that you never again have to do a -C or -c for this RAID set :)

> How can I pop a new wd1 back in? disklabel it, but then how can I get past
> the loop I was in before?

Do the above 'raidctl -A yes raid0', and then do a shutdown.  Pop the 
new wd1 back in.  Bring the system back up.  raid0 will be automatically
configured, and will look something like:

# raidctl -s raid0
Components:
          component0: failed
           /dev/wd2a: optimal
No spares.
/dev/wd1a status is: failed.  Skipping label.
Component label for /dev/wd2a:
   Row: 0, Column: 1, Num Rows: 1, Num Columns: 2
   Version: 2, Serial Number: 35710, Mod Counter: 277
   Clean: No, Status: 0
   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
   Queue size: 100, blocksize: 512, numBlocks: 490234624
   RAID Level: 1
   Autoconfig: Yes
   Root partition: No
   Last configured as: raid0
Parity status: DIRTY
Reconstruction is 100% complete.
Parity Re-write is 100% complete.
Copyback is 100% complete.

(Mod Counter might be different than above :) )
At that point you can do:

 raidctl -a /dev/wd1a raid0

to hot-add wd1a to the set, and then:

 raidctl -F component0 raid0

to rebuild onto wd1a.  You can either keep running like this, or, if 
you'd like, reboot.  After reboot, wd1a will 'magically' appear in 
its correct spot in the set.  (Again: you must do the 'raidctl -A' 
above for all of this to work properly..)

Later...

Greg Oster