Quantcast

Transparent Backups and the Ultimate MacBook

I finally went through the old hard drive from my B&W G3. The machine is long gone but I took out the drive because I wanted to save the GIS stuff and other random projects from the carefree and unemployed days of the dot-com crash. Along the way I’ve learned many things about drives and RAID and booting and hard to make a FireDrive bootable. It took awhile but here are a couple of my findings.

a:\> sys a: c:

Remember “sys” ? In the dark days of DOS, man that was super helpful. “sys” would transfer the system files from one disk to another and make the disk bootable. Didn’t matter if the disk was a floppy or your internal hard drive, it just worked. Well, these days the normal installation process for Windows, Linux, or Mac OS X takes the better part of an hour. But I’ve found a new friend in the darwin command “asr” (which stands for Apple System Restore). “asr” is used in the Apple manufacturing process, so you know it’s good stuff. And you don’t have to use the command line. You can do the same stuff with the “Disk Utility” application.

If you set things up right, “asr” will perform the function of Carbon Copy Cloner except way faster. To get the juice you need to do the following:

  • Boot from a Volume that you are not using as a source. This could be an install CD or, if you are pimpin’ four external firewire drives like I am, use one of those.
  • Fire up Disk Utility, click on the drive you want to copy to and click the “Restore” tab.
  • From there, drag the source drive to the “source” thingy and the destination drive to the “destination” thingy. (Is this a Mac or what? Remember fdisk?)
  • You don’t want anything on your destination drive, right? Cause we are about to nuke the whole thing. Double click the destination drive in Finder to make sure you know what you’re doing.
  • Click the “erase” checkbox and then click the “Restore” button.

At this point Disk Utility should be saying “Copying Blocks ..” with a progress bar. This sweet block copy mode clones my 16GB system in less than 15 minutes. That’s longer than the 3 seconds from the “sys” days, but it’s way better than waiting an hour to copy file-by-file. Remember, to get the juice the source drive must be unmountable (i.e. not your boot drive) and you have to be doing an Erase install.

A Backup I Will Actually Use

Do you do backups? Most people don’t … I certainly don’t. Except for this old G3 drive, I’ve never really done backups. I mean do I need to hang on to my Web Browser Cache files? Typically anything important I’m doing on the computer is A) Email or B) code checked in to source control. But these days the digital pictures are piling up, and I want to save them even though I know I’ll never look at them.

The key for me is going to be Apple’s software RAID system. It took me a while to understand but it’s good stuff. For my data and pictures I have two 160GB firewire drives configured RAID-1 (mirroring). This is a pretty stock setup, except I made an extra 20GB partition on both drives so I can …. well, those partitions come in handy sometimes when I’m trying to do stuff.


But the coolest thing is setting up my laptop’s hard drive to be part of a RAID mirror. This feature will allow me to have the Ultimate MacBook: one that is impervious to hard drive failures. How do I do it? Set up the internal hard drive to be part of a RAID Mirror set. I didn’t even know you could do this, but you can. Here are the steps:

  • First you need an empty partition on a FireWire drive. This is going to be the other half of the mirror. Make sure this partition is smaller than your internal hard drive. Otherwise the stars won’t align correctly. You might have to repartition your FireWire drive for this to work. Oh, and this is a good time to mention that your FireWire drive might need to have a “GUID Partition Table” if you want it to boot Intel Macs. I’m not sure of all the cases but I just made mine GUID because I will only be using this on MacBooks.
  • OK, you’ve got your partition set up. Nothing you want on there right? Cuz it’s curtains for that data. Fire up Disk Utility and “Erase” the partition, which puts a nice fresh (empty) file sytem on there.
  • Now quit Disk Utility and execute the following in Terminal:

    diskutil enableRAID mirror /Volumes/YourFreshEmptyPartition

  • Cool, you’ve got one half of a RAID mirror up, with nothing on it. Now we use the hint from above and “Restore” your internal drive onto this empty RAID. Drag the RAID Mirror drive to the Restore “Destination” and drag your internal drive to the “Source”. Remember, if you booted from your internal drive it’s not unmountable and you won’t get the speedy “Block Copy” behavior. Click the “Erase” checkbox and watch the bits fly….
  • Sweet, you now have a copy of your internal drive on the RAID (which still only has one Slice at this point). At this point we are going to nuke your internal drive, so you Really, Really, Really should check it out and know whats up.
  • Ready? In Disk Utility, click on your RAID drive and hit the RAID tab. Now drag your internal drive onto the RAID set. (goddam!! I mean really, this kicks 3ware in the pants…)
  • Important!!! Click the “Options…” button and make sure “RAID Mirror AutoRebuild” is checked. You can’t change this later, and trust me, this is what you want.
  • After you’ve added Mr. Internal Drive to the RAID set, you’re basically done. The set should automatically start rebuilding itself. Yeah, it takes a long time (about 2 hours for the 100GB RAID Mirror I have set up with my MacBook Pro’s internal drive), but I think it’s worth it.
  • Make sure the rebuild has completed, then use System Preferences “Startup Disk” to set your startup disk to this new RAID array.


So what’s up with this rebuilding thing? Well, any time you disconnect the FireWire drive, the system assumes you might have changed some data on the disk. So it sync’s up the two drives, but the algorithm is naive — it just copies block by block. This if fine for my purpose. Basically when I come home I plug my laptop to the power supply to recharge the battery, and plug in the FireWire slice of my RAID mirror to “recharge” my data. Since I let all of those things stew overnight anyway, it doesn’t matter that it takes two hours to rebuild. The rebuild process is nice and quiet in the background too. It takes up about 4% of CPU (via the kernel_task). Compare that to rsync, which was using between 40%-100% of CPU in the tests I was doing. And if you have used other backup software … well, you know how crappy it is to be enumerating the filesystem and l dribbling weird programs all over your Mac. It’s all about the software RAID running at the disk block level.

But the biggest feature is the transparency. Because it’s so automatic, as easy as plugging in the power cord, I know this is backup that will actually happen as opposed to me just thinking about it.

I think I’ll throw a second FireWire drive in there just to be extra safe.

No comments yet. Be the first.

Leave a reply