"The more I find out, the less I know."

Tuesday - February 21, 2006 at 09:20 PM in

HowTo: Set up a RAID mirror under OS X for the ultimate hard drive backup


Introduction: Back in November I wrote about setting up a RAID array on my new Mac using a bunch of external hard drives I had sitting around. RAID stands for Redundant Array of Inexpensive Disks, and is a way to bind together multiple disks into one larger and/or more reliable virtual disk. RAID sounds complicated, but it is built in to Mac OS X, and isn't even that hard to set up.

One application in particular is extremely handy: setting up two (or more) hard drives to mirror each other to provide a constant backup. Known as a Mirrored RAID (or RAID 0 in geek-speak), this configuration keeps all the drives in the RAID array constantly backing each other up. If any drive fails, the other(s) take over immediately and seamlessly. In fact, you might not even know that your hard drive has failed, unless you happen to see the smoke.

Setting up a RAID array as your boot drive in Mac OS X isn't hard, but it does take some time. The payoff is worth it: you will be secure in the knowledge that you will never again lose any data to a hard drive failure.
Materials: You will need:

1) A Mac

2) An external (preferably FireWire) hard drive with at least as much capacity as your Mac's internal hard drive. This is the "mirror drive" (and you can have more than one for extra redundancy)

3) An external (FW or USB) hard drive with at least as much space available as you are currently using on your Mac. This will be a "scratch drive" you use for setting up the RAID, so you can borrow a drive from a friend and return it.

4) Your Mac OS X Installation Disk, either one that came with the computer or one you used to upgrade it.

To find out the capacity of your hard drive, click on the drive in the Finder and select "Get Info" (apple-I). If you're buying a new hard drive for your backup, get a drive with at least 8% more capacity as Finder reports as the capacity in the Get Info window--that's to allow for different ways of measuring hard drive capacity and formatting overhead. So if Finder says your hard drive has a capacity of 232 GB, get at least a 250 GB external drive. It's OK to get an external drive bigger than your existing drive--we can recover the extra space.

Overview: There are essentially three steps:

1) Copy the entire contents of your hard drive onto the scratch disk.

2) Set up the RAID array

3) Copy the contents of the hard drive from the scratch disk onto the RAID array.

Detailed Set-Up: Boot your Mac, insert the OS X Installation Disk, and double-click on "Install Mac OS X." You'll be asked to reboot your computer and probably enter your admin password.

Note: These instructions are for 10.4; earlier versions may have some slight differences.

The computer will boot off the OS X Installation Disk. This is necessary because you're going to completely rebuild the hard drive, which means that the hard drive can't be the boot disk.

You will be asked to select your language, then you will be at the screen to begin installing OS X. That's not what you want, though: you want to launch Disk Utility.

In the 10.4 installer, the Disk Utility is found under the "Utilities" menu. Choose it, and Disk Utility should launch.

Plug in your scratch disk (if you haven't already). It should appear in the bar on the left-hand side of the window, along with the Macintosh HD (your internal hard drive) and the OS X Installation Disk.

Select your Macintosh HD in the bar on the left-hand side of the window.

From the File menu, choose "New...Disk image from Macintosh HD". Save the new disk image somewhere on the scratch disk.

Your computer will now begin copying the entire contents of your internal hard drive into a file on the scratch disk. Depending on how much stuff you have saved, this could take a while; perhaps a few hours.

Once the new disk image is complete, plug in the mirror drive (if you haven't already). It should appear in the bar on the left-hand side of the window.

If your mirror drive is bigger than your internal hard drive: We want to recover this extra space to be usable, so select the mirror drive, then choose "Partition" in the area in the right-hand side of the window. Set up two partitions, and move the bar between them until the first partition is the same size (or slightly larger) than the size of your internal hard drive. Name the first partition "Mirror" and the second partition "Extra Space."

Now we're ready to configure the RAID array. Select your internal hard drive, and choose "RAID" on the right-hand side of the window. Create a new RAID Set named Macintosh HD, with volume format "Mac OS Extended (Journaled)" and RAID Type "Mirrored RAID set". Drag the mirror drive into the raid set (or the Mirror partition of the mirror drive, if you set up two partitions).

Click "Options" and make sure "RAID Mirror AutoRebuild" is checked.

Finally, click "Create" to create the RAID set.

Congratulations! You've set up the RAID! Now all you need to do is copy your hard drive back onto the new RAID set and you're done.

Click "Restore" in the right-hand side of the window. For "Source" drag the image of the internal hard drive you created earlier. For Destination, drag your newly created RAID set. Select "Erase Destination" and "Restore."

Your computer will now copy your hard drive back onto the RAID set. This may take a few hours.

When it's done, you're done. Quit Disk Utility, then go to Startup Disk (in 10.4, this is in the Utilities menu) and choose Macintosh HD (your new RAID set) and click Restart...

Done: You now have a RAID mirror of your internal hard drive. Any time both drives are connected and functional, the computer will keep them both synchronized. If one fails (or is unplugged), the computer will keep working on the remaining drive(s). If a drive is reconnected to the array, the computer will update it to the right state.

To verify this, once you've rebooted your computer you can open Disk Utility and choose your Macintosh HD, then select "RAID" from the panel on the right hand side. It should show all the disks in the array, along with the status of each. If you unplug the external drive, it will change the array status to "Degraded" and show the external drive as "offline." Plug it back in, and it should show the external drive as "rebuilding."

Posted at 09:20 PM | Permalink | | |

©
Powered By iBlog, Comments By HaloScan
RSS Feed