So, I had occasion to rebuild a 3ware RAID array under Linux

And as I had a damned hard time getting it to go, I’m noting what I did here so that it might benifit myself and others. This is using the 9.3.0.X version of the 3ware CLI software–though it says that it’s for the 9500 series of controllers, it’s really for any kernel after 2.6.10: the 9500 controllers introduced a new way of talking to the controller, and the driver for the 7/8000 series was retrofitted with it.

So, you had a drive fail, and you pulled it and swapped it, now you want to get things rebuilding so you feel nice and safe again.

So, all the action here is going to be within the tw_cli interface, which you start with something like:

bc. william:~# ./tw_cli
//william>

*If you hot-swapped the drive*, you will first need to get the system to rescan and notice the new drive. If you cold swapped the drive, the act of restarting the machine will get it to rescan. To do this, you would use a command like:

bc. //william> rescan
Rescanning controller /c0 for units and drives …Done.
Found the following unit(s): [/c0/u1].
Found the following drive(s): [none].

So then you might look at the status of your system:

bc.. //william> /c0 show

Unit UnitType Status %Cmpl Stripe Size(GB) Cache AVerify IgnECC
—————————————————-
u0 RAID-1 DEGRADED – – 74.5294 ON – –
u1 JBOD OK – – 74.5304 ON – –

Port Status Unit Size Blocks Serial
——————————————
p0 OK u0 74.53 GB 156301488 3JV92V3H
p1 OK u1 74.53 GB 156301488 3JV8XXVK

p. So, you’ve got your degraded RAID-1 unit, and *fook!*, the stupid controller thinks you want ot use the second drive as a separate unit. What are you to do?

First, you need to delete the spurious unit. Needless to say, type carefully, and double-check everything here:

bc. //william/c0> /c0/u1 del noscan
Deleting /c0/u1 will cause the data on the unit permanently loss.
Do you want to continue ? Y|N [N]: y
Deleting unit c0/u1 …Done.
Now you’ll see something like:

bc.. //william> /c0 show

Unit UnitType Status %Cmpl Stripe Size(GB) Cache AVerify IgnECC
—————————————————-
u0 RAID-1 DEGRADED – – 74.5294 ON – –

Port Status Unit Size Blocks Serial
——————————————
p0 OK u0 74.53 GB 156301488 3JV92V3H
p1 OK – 74.53 GB 156301488 3JV8XXVK

p. Now you need to recreate that unit as a spare:

bc.. //william> /c0 add type=spare disk=1
Creating new unit on controller /c0 … Done. The new unit is /c0/u1.

//william> /c0 show

Unit UnitType Status %Cmpl Stripe Size(GB) Cache AVerify IgnECC
—————————————————-
u0 RAID-1 DEGRADED – – 74.5294 ON – –
u1 SPARE OK – – 74.5304 – – –

Port Status Unit Size Blocks Serial
——————————————
p0 OK u0 74.53 GB 156301488 3JV92V3H
p1 OK u1 74.53 GB 156301488 3JV8XXVK

p. Once that’s done, you can tell it to attach that spare unit to your degraded RAID and start rebuilding:

bc. //william> /c0/u0 start rebuild disk=1
Sending rebuild start request to /c0/u0 on 1 disk(s) [1] … Done.

And, after a while, you will see something like:

bc.. //william> /c0 show

Unit UnitType Status %Cmpl Stripe Size(GB) Cache AVerify IgnECC
—————————————————-
u0 RAID-1 REBUILDING 27 – 74.5294 ON – –

Port Status Unit Size Blocks Serial
——————————————
p0 OK u0 74.53 GB 156301488 3JV92V3H
p1 DEGRADED u0 74.53 GB 156301488 3JV8XXVK

p. Dry, boring, technical, and presented without a warranty, but I sincerely hope it helps you in rebuilding your drive.

Published by

Michael Alan Dorman

Yogi, brigand, programmer, thief, musician, Republican, cook. I leave it to you figure out which ones are accurate.