Sept. 15, 2011, 12:54 p.m.
IT

Rebuilding Failed RAID1 on Mac OS X

I recently had one drive in a two non boot disk Mac OS X software RAID1 set being marked as FAILED. Since the disk seemed good, I shut down the computer, reseated all the drives and booted it back up. The failed drive showed up, but marked as FAILED.

I went to Terminal, and entered:

waldo@waldopcm-3 ~ $ sudo diskutil appleRAID list
AppleRAID sets (1 found)
===============================================================================
Name:                 Photo Library 2TB
Unique ID:            89A5283E-228D-46DE-B40C-9564642F0D21
Type:                 Mirror
Status:               Degraded
Size:                 2.0 TB (2000054910976 Bytes)
Rebuild:              manual
Device Node:          disk6
-------------------------------------------------------------------------------
#  DevNode   UUID                                  Status     Size
-------------------------------------------------------------------------------
0  disk0s2   1DAD80E6-852C-482C-8538-B517E0365597  Failed     2000054910976
1  disk3s2   38381E2E-D571-4EE6-9C58-D55502953D86  Online     2000054910976
===============================================================================

Next step was to remove this disk from the RAID1 set:

waldo@waldopcm-3 ~ $ sudo diskutil appleRAID remove 1DAD80E6-852C-482C-8538-B517E0365597 disk6
Started RAID operation on disk6 Photo Library
Removing disk from RAID
Changing the disk type
Finished RAID operation on disk6 Photo Library

That done, I needed to re-add the drive I just removed:

waldo@waldopcm-3 ~ $ sudo diskutil appleRAID add member disk0 disk6
Started RAID operation on disk6 Photo Library
Unmounting disk
Repartitioning disk0 so it can be in a RAID set
Unmounting disk
Creating the partition map
Adding disk0s2 to the RAID Set
Finished RAID operation on disk6 Photo Library

That triggered the rebuild. You might be able to do this from the GUI (Disk Utility), but everything I tried indicated that it would do things I am not comfortable with or do not fully understand. In the steps above, there is no ambiguity in what is being done.

waldo@waldopcm-3 ~ $ sudo diskutil appleRAID list
AppleRAID sets (1 found)
===============================================================================
Name:                 Photo Library 2TB
Unique ID:            89A5283E-228D-46DE-B40C-9564642F0D21
Type:                 Mirror
Status:               Degraded
Size:                 2.0 TB (2000054910976 Bytes)
Rebuild:              manual
Device Node:          disk6
-------------------------------------------------------------------------------
#  DevNode   UUID                                  Status     Size
-------------------------------------------------------------------------------
0  disk3s2   38381E2E-D571-4EE6-9C58-D55502953D86  Online     2000054910976
1  disk0s2   83CA58A3-BDDD-454D-AD77-C848EA4C3CD1  2% (Rebuilding)2000054910976
===============================================================================

Even though it seems inefficient rebuilding the set by cloning the whole disk at the block level, I am quite impressed at the sustained rebuild speed. These are WD Green disks so not the fastest out there, but still:

Rebuild Speed
Rebuild Speed