replacing a failed RAID component

View: New views
4 Messages — Rating Filter:   Alert me  

replacing a failed RAID component

by Steven Bellovin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm using RAIDFRAME in a RAID 1 configuration.  One of the disks has  
failed and needs to be replaced; the question is how, precisely, I do  
it.  More specifically, how do I prepare the new disk?  My assumption  
is that I have to set up the proper fdisk label (including the boot  
block); I then have to use disklabel to make the 'e' partition of type  
RAID.  The last thing I should do is use 'raidctl -R' to reconstruct  
the RAID set.

Do I need to do anything else?  Do I need to do something to  
initialize the replacement disk's RAID stuff?

                --Steve Bellovin, http://www.cs.columbia.edu/~smb






Re: replacing a failed RAID component

by Stephen Borrill-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 7 Nov 2009, Steven Bellovin wrote:
> I'm using RAIDFRAME in a RAID 1 configuration.  One of the disks has failed
> and needs to be replaced; the question is how, precisely, I do it.  More
> specifically, how do I prepare the new disk?  My assumption is that I have to
> set up the proper fdisk label (including the boot block); I then have to use
> disklabel to make the 'e' partition of type RAID.  The last thing I should do
> is use 'raidctl -R' to reconstruct the RAID set.
>
> Do I need to do anything else?  Do I need to do something to initialize the
> replacement disk's RAID stuff?

A cheap hack is to use dd to copy the first few sectors (i.e. including
mbr code, fdisk partition table and diskabel) from one disk to the other.

Then use raidctl -a, raidctl -F, etc. to rebuild the array.
--
Stephen


Re: replacing a failed RAID component

by Steven Bellovin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Nov 7, 2009, at 11:47 AM, Stephen Borrill wrote:

> On Sat, 7 Nov 2009, Steven Bellovin wrote:
>> I'm using RAIDFRAME in a RAID 1 configuration.  One of the disks  
>> has failed and needs to be replaced; the question is how,  
>> precisely, I do it.  More specifically, how do I prepare the new  
>> disk?  My assumption is that I have to set up the proper fdisk  
>> label (including the boot block); I then have to use disklabel to  
>> make the 'e' partition of type RAID.  The last thing I should do is  
>> use 'raidctl -R' to reconstruct the RAID set.
>>
>> Do I need to do anything else?  Do I need to do something to  
>> initialize the replacement disk's RAID stuff?
>
> A cheap hack is to use dd to copy the first few sectors (i.e.  
> including mbr code, fdisk partition table and diskabel) from one  
> disk to the other.
>
> Then use raidctl -a, raidctl -F, etc. to rebuild the array.


-a and -F?  I was assuming I could just do -R.  I confess that I'm  
quite unclear about the difference here.

I had thought about the dd hack, but was unsure if there things like a  
disk name that I shouldn't copy over that way.

                --Steve Bellovin, http://www.cs.columbia.edu/~smb






Re: replacing a failed RAID component

by Stephen Borrill-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 7 Nov 2009, Steven Bellovin wrote:

>> On Sat, 7 Nov 2009, Steven Bellovin wrote:
>>> I'm using RAIDFRAME in a RAID 1 configuration.  One of the disks has
>>> failed and needs to be replaced; the question is how, precisely, I do it.
>>> More specifically, how do I prepare the new disk?  My assumption is that I
>>> have to set up the proper fdisk label (including the boot block); I then
>>> have to use disklabel to make the 'e' partition of type RAID.  The last
>>> thing I should do is use 'raidctl -R' to reconstruct the RAID set.
>>>
>>> Do I need to do anything else?  Do I need to do something to initialize
>>> the replacement disk's RAID stuff?
>>
>> A cheap hack is to use dd to copy the first few sectors (i.e. including mbr
>> code, fdisk partition table and diskabel) from one disk to the other.
>>
>> Then use raidctl -a, raidctl -F, etc. to rebuild the array.
>
> -a and -F?  I was assuming I could just do -R.  I confess that I'm quite
> unclear about the difference here.

-R fails a component (if necessary) and rebuilds back onto that component.
-a adds a hot spare and then -F fails a component and rebuilds onto the
hot spare. Chances are your components are currently something like
/dev/wd0e and component1, you would need to add /dev/wd1e and then fail
component1. You couldn't just use -R on the failed component as the new
disk won't have the component label on it at boot time.

--
Stephen