You are here

RAID at Home with Mac OS X

This is the rest of the story about RAID with Mac OS X. The first postexplains what RAID is for and how I use it in general. This one talks more specifically about RAID support in OS X and how I use it to keep my system backed up.

 

RAID on the Mac is a mixed bag: kind of easy but kind of hard. These days, a practical backup system really needs to preserve your entire hard drive environment: home directories, system configuration, and installed applications. Unfortunately, Apple doesn't make this easy. It's not bad once you get it set up and know a few tricks, but I was annoyed at the learning curve.

 

Last summer I bought a Mac Pro for home use. A major reason for choosing the Pro was its hard drive arrangement. It is ridiculously easy to swap drives in and out:

  1. Turn off the machine
  2. Flip the lever to release the side cover
  3. Grab the bracket holding the hard drive you want to remove
  4. Then just pull it out - no cables!

I have mixed opinions about the Mac software these days, but the Pro is a terrific piece of computer chassis design. It looks trim and classy, it's quiet, and did I mention that it's easy to swap hard drives? It's also easy to upgrade RAM.

Configuring RAID

On Mac OS X, you use the Disk Utility to configure RAID. The software makes it easy to put data disksinto a RAID set. This is OK if your goal is to speed things up using RAID 0, or if you don't use many 3rd party applications.

 

Personally, I have a full suite of Adobe applications on my Mac along with any number of other odd applications I've picked up along the way. If I lose my system disk, it can take days to reinstall everything. I want to do RAID 1 for reliability, and I want my whole systemon the RAID set.

 

It's not exactly easy to put your entire system on a RAID set. Essentially you have to reinstall from scratch. The process goes like this:

  1. Turn off the machine.
  2. Install the hard drives you want to use in the RAID set.
  3. Boot from the system installation CD/DVD.
  4. Use Disk Utility to create a RAID set on the intended hard drives. This erases the contents of said drives.
  5. Install OS X from scratch onto those new hard drives.

You now have a RAIDed system. I've seen suggestions online about ways to trick OS X into creating a RAID set without wiping the hard drive's contents, but I'm skeptical. The whole point is to increase reliability, and you don't do that by using tricks the vendor doesn't necessarily endorse. If Apple is willing to publish a guide on how to do this, I'll be willing to try it. More likely, they'd just integrate the process into their Disk Utility.

Swapping Drives

Once it's set up, the RAID 1 system really works. If a drive fails, or if you just remove it, the system happily runs on the remaining hard drive. If a disaster befalls my whole system, I bring in my off-site spare (part of an earlier RAID set) and I reboot from there.

 

The tricky part, however, is replacing a missing drive.

 

In a previous post I described how I use 3 drives: A, B, and C. Two drives are installed in my Mac Pro at home to provide the RAID set. The third drive sits in a drawer at my office to provide an off-site backup. Every few weeks I swap between the off-site drive and the spare drive so the off-site copy doesn't get too old. After all, if disaster strikes, I might lose everything I've done since swapping the off-site backup.

 

Let's work an example in which I have drives A and B installed in my Pro, and drive C sitting in my office drawer. It's time to swap the backup drive. Here is the process:

  1. Bring Drive C home.
  2. Erase Drive C. This is harder than it sounds. I've found the safest thing to do is to plug it into a Windows box and use diskpart from the command line to "clean" all formatting information from the volume. Then I give it a FAT file system.
  3. Turn off the Mac Pro
  4. Remove Drive B.
  5. Insert Drive C.
  6. Boot up the Mac Pro. The RAID system will boot up in a "degraded" state, since the second drive is missing.
  7. Start up the Disk Utility.
  8. Reformat Drive C to be use Mac HFS format.
  9. Add Drive C to the degraded RAID set.
  10. Click the "Rebuild" button. This takes over an hour for a 250G hard drive, but you can keep working while it's going.
  11. Take Drive B to the office and leave it in a drawer. That's now my off-site backup.

The reason I use diskpart is because the OS X RAID system doesn't always realize when the drives have been swapped. If the swapped-in drive has never been part of the RAID set, then it works fine. If the swapped-in drive looks like it might bepart of the RAID set, then the RAID system might just start using it. This spells disaster if the swapped-in drive is not really a mirror copy of the other drive.

 

The diskpart "clean" command removes all volume and partitioning information from a drive, including names. I'm not sure how the RAID set identifies potential members, but I suspect it's related to the volume or partition name.

 

This process is aided by a vital bit of hardware: a USB to SATA cable. To reformat Drive C, I attach the cable to Drive C, plug the USB end into my computer, and then run diskpart. These cables are easy to find and order on-line: a typical set provides a power cable and a signal cable to plug into the drive. The other end of the signal cable is a USB connector that plugs into your computer.

 

A bit of folklore about these cables: like automotive jumper cables, there's a specific order in which you should hook them up. Attach the SATA and power connecters first, then plug in the power supply to spin up the drive. Note that you may have a choice between the classic Molex drive connector (thick, white plastic with four large pins) or a flat SATA power connector: use one or the other. Once the drive is running, plug the USB connector into the computer's USB port. So the last step is to connect the cable to the computer itself.

Post category: 
Wordpress tag: 

Comments

Under "Swapping Drives" steps 8 and 9, should that say Drive C instead of Drive B? Drive B is the drive you're taking to the office; it would be a backup if you re-format it.

Correct. I've fixed it. In any case, I've posted a more recent summary of the procedure that's more accurate. And, since I use both PCs and Macs, I've changed from Drives A, B, and C (which may refer to the wrong drives on a PC) to Drives X, Y, and Z (which have no generally accepted meaning on a PC).

I tried using like your tut and succeeded. Thank you a lot

sasha grey

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer