Thursday, June 14, 2012

How to Repair raid with Spare Drive?

Raid Repair with Spare Drive:

I had set up one of our raids with a spare drive. A disk in this raid failed last night and the spare was used immediately. Unfortunately, I forgot that this raid had a spare, so I spent a bit of time trying to figure out why the new disk would not rebuild. But eventually, things worked again. Here’s my log:

[root@cps1 ~]# cd tw_cli
[root@cps1 tw_cli]# ./tw_cli
//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520
p2     OK               u0     465.76 GB   976773168     WD-WCANU2030999
p3     DEVICE-ERROR     u?     465.76 GB   976773168     WD-WCANU2021246
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -
The first thing I should have noticed is that the raid was ok. Normally, if there’s a bad drive it shows up as degraded. But, I completely missed that fact and tried to rebuild it.
//cps1> maint remove c0 p3
Removing port /c0/p3 ... Done.