Subject: Re: Raidframe and raidset initialization
To: Greg Oster <oster@cs.usask.ca>
From: Tobias Nygren <tnn+nbsd@nygren.pp.se>
List: netbsd-users
Date: 03/09/2007 20:27:43
Greg Oster wrote:
> Jason White writes:
>   
>> I'm looking for a definitive answer and/or clarification to the following.
>> The raidctl manpage for the '-i' option says:
>>
>>   "In particular, (re-)write the parity on the selected device.  This MUST be
>>  
>>    done for all RAID sets before the RAID device is labeled and before file 
>>    systems are created on the RAID device."
>>
>> I realize it may be a fine point, but does the initialization have to 
>> *finish* before the raid device can be used or is it sufficient to have 
>> merely started initialization?  I'm aware that I can manipulate the raid 
>> device, but is it safe to do so before initialization is complete?
>>     
>
> What you can get away with (and what you shouldn't try to get away 
> with) depends on the RAID level being used, and on how valuable your 
> data is.  If you don't particularly care too much about the data you 
> can start using the RAID set even before it is initialized.  For a 
> RAID level 1 set, you're probably OK, even if a component fails.  For 
> a RAID level 5 set, you're likely going to end up with scrambled data 
> (depending on what was on the drives before -- if it was all zeros, 
> you might be OK there too).
>
> The manpage talks about the safest course of action... if you're in a 
> hurry to get real data "back on-line" you might build a RAID 5 set, 
> restore the data, and *then* do the initialization -- with the 
> knowledge that if a component fails, you might have to do the 
> whole operation all over again... But I wouldn't recommend doing that 
> unless, for example, you know that the components contain all zeros 
> before the RAID set is constructed (i.e. that the parity was actually 
> all correct before the check!! :) ).
>
> Later...
>
> Greg Oster
>
>
>   


Using a raid set without initializing parity isn't that different from 
creating a
filesystem on a harddisk without zeroing all sectors first.

Sure, parity will be wrong for sectors which haven't previously been 
alloc'ed
in the filesystem. But because parity is updated on writes, sectors that are
relevant to the filesystem will have the correct parity.
This of course doesn't apply if the raid employs fancy checksum control 
of parity.

Performing the parity initialization is good for another reason: it 
makes sure
that all blocks in the components are accessible. You don't want to 
begin using
a raid set that might have a failing disk.

-Tobias