Rebuilding Software RAID Arrays in OS X 10.5 Leopard

While moving some data between drives today I decided to test the drive build functionality of my external RAID array.
I have an IOI FWBU2SATA35DMR Firewire/USB enclosure with two 500GB SATA drives in a RAID 1 configuration. Following the instructions I powered down the array, removed one of the disks, powered it back up, wrote some data, powered the array down and reinstalled the second drive. To my dismay instead of rebuilding the second disk the drive would begin the rebuild (indicated by the status lights) and then immediately return to 1 good 1 failed. I let this run for a good 12 hours without luck.

So I decided that for my needs the software RAID supplied by OS X would be sufficient. Off to Disk Utility to build the set. Disk Utility allows you to create a mirrored RAID array in a degraded state (preserving any data on the drive) and then add members to the array and rebuild. I created the initial array with a single partition member and then attempted to add the second partition only to receive Unrecognized Filesystem.

I guessed that this was an issue with the Disk Utility interface and not the underlying software RAID so I decided to give it a try from the command line. Sure enough it worked right away. Here are the commands to add a disk or partition to an existing software RAID array:

Be very careful when running these commands! If the wrong device is selected you can easily destroy an entire disk of data!

Get a list of device names with:

# diskutil list

Next find the Unique ID for your RAID array:

# diskutil checkRAID

Finally, add the new member to the array. Replace AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE with the Unique ID obtained above and diskXsX with the appropriate device:

# diskutil addToRAID member /dev/diskXsX AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE

The array should automatically begin to rebuild itself. You can check by re-issuing the diskutil checkRAID command. The rebuild status will automatically be shown if Disk Utility is launched.

Comments are closed.