nbalonso.com

Advanced RAID Options

| Comments

Today I decided that was time to fix one of the Xserve that I administer and was reporting a problem with the RAID for a long time. The server is far from being critical, that is why I did not bother before.

As a side not remember that the Xserve 3 drive bays, but you could easily export this example for whatever other Mac computer you have.

So when I opened the RAID Utility it was reporting that both volumes where degraded, the RAID set was set to raid5 was also degraded and there where only two hard drives showing, both in green status.

Reading the message clearly stated that the RAID set was degraded because there was no spare drive, no wonder when you think that this is supposed to be a raid5 with two drives!

Ok, so first diagnose clearly showed that drive in bay 1 was dead. Replaced the drive but no luck. Restarted the server and there it was, the new drive showing in green status but not assigned to any RAID set therefore was roaming.

I checked all the options around the RAID util but no option to add one roaming drive to an existing raid set. A colleague mentioned that back in the old days he used to use the command line to do this “advanced tasks”. Checked the available command line software and found the excellent raidutil. A quick read through the man page (download here) and jumped to try things.

First list the devices available

1
2
3
bash-3.2$ raidutil list
     Device Name    Device Type    Device URL
  0  AppleRAIDCard  AppleRAIDCard  x-raid-device://localhost/AppleACPIPlatformExpert/[email protected]/AppleACPIPCI/[email protected]/IOPCI2PCIBridge/[email protected]/AppleRAIDCard#AppleRAIDCard

Only one RAID controller (how useful :S )

Then listed the drives

1
2
3
4
5
6
bash-3.2$ raidutil list driveinfo
Drives  Raidset       Size      Flags
-------------------------------------------------------------------
Bay #1  <none>          1.00TB   IsReliable IsNotAssigned IsRoaming
Bay #2  RS1           160.04GB   IsMemberOfRAIDSet:RS1 IsReliable
Bay #3  RS1           160.04GB   IsMemberOfRAIDSet:RS1 IsReliable
1
2
3
4
5
bash-3.2$ raidutil list raidsetinfo
                                     Total     Avail
Raidsets      Type       Drives       Size      Size  Comments
----------------------------------------------------------------------
RS1           RAID 5     2,3      313.42GB    0.00MB  No tasks running

The new drive is the bigger one. This confirms what we see in the gui

Then tried to join the new drive to the raidset

1
2
3
4
bash-3.2$ sudo raidutil modify drive  --addlocalspare --raidsets RS1 --drives 1
Password:
Modifying drives...   FAILED.
The configuration request could not be complete because a drive is roaming.

But no luck, error. What if we adopt first the drive?

1
2
bash-3.2$ sudo raidutil modify drive --adopt --drives 1
Modifying drives...   complete.

And then add it to the raidset

1
2
bash-3.2$ sudo raidutil modify drive  --addlocalspare --raidsets RS1 --drives 1
Modifying drives...   complete.

That should get the rebuild started. Let’s confirm

1
2
3
4
5
bash-3.2$ raidutil list raidsetinfo
                                     Total     Avail
Raidsets      Type       Drives       Size      Size  Comments
---------------------------------------------------------------------------
RS1           RAID 5     1,2,3    313.42GB    0.00MB  Rebuild: 40% complete

Excellent! done

I got excited to learn this new tool and see how easy and powerful it is to use. This can be used to remotely administer and check raid configurations and to script some setups

Comments