Skip to content

Mac OS X backups

While Time Machine has been much-ballyhooed, it is not exactly a backup product (it provides continuous data protection—provided you keep the extra hard drive that you MUST use for Time Machine to work at all connected at all times), nor is it a host imaging product. It's good for “damn, I didn't mean to change that file that way”, but it's not clear that it's all that hot for “restore this system to a default image” (like you'd want in a lab environment) nor for “the system is completely fragged” (say, from an OS upgrade gone wrong).

In those cases, one wants something more like what described a couple of months ago, except that he's missing a few steps necessary to make the resulting disk bootable that Brad Bergeron includes in his description of how to make a bootable USB key with Mac OS X (possibly a handy tool).

First, when you format a new HFS+ drive, it's easy to not enable the “owners enabled” setting. I'm hazy on exactly what that setting really means (thanks for acting like MS, Apple), but I have the impression it means that any user on the host can read all files on the attached disk, rather like mapping anonymous users to root for NFS. I'm taking Brad's word for it that this needs to be changed for Mac OS X to boot from the volume, but it stands to reason. You fix that with the /usr/sbin/vsdbutil command (which, apparently, doesn't have a man page). You probably only need to do this once per volume, but it doesn't take any time or hurt to explicitly activate each time, so whatever.

Second, after copying data to the volume, one must bless(8) the CoreServices directory in the System Library, which enables the BootX application in that directory on that volume and puts the EFI appropriate for booting the OS based in the CoreServices directory on the disk in question.

So, now my backup script for my two Mac laptops (one already upgraded to 10.5, since if the upgrade fragged it I'd just reinstall—its primary use is to run the stereo, one on which I'm making sure I've got a bootable fallback before I do the same) looks like this (modulo actually having most of this in shell variables):

target=/Volumes/whatever
vsdbutil -a $target
rsync -avxE –delete –ignore-errors / $target
bless –folder “${target}/System/Library/CoreServices” –bootinfo –verbose

recommends rsyncing to a hard drive that you can physically swap into your system. That's perfectly sensible advice, but it's not totally necessary. With Intel Macs, you should be able to choose an exernal disk (FireWire or USB) in the “Startup Disk” System Preference or by holding down option as the system boots (these are the same ways you switch into BootCamp, of course). With a PowerPC Mac, Brad believes you need to do the normal OpenFirmware thing that should be old hat if you've run a BSD or Linux distribution on a PowerPC Mac before. Essentially, boot into OF (apple-option-O-F), locate the device from which you want to boot in the devalias output (it may be easier to find this path if you've previously looked at the device list in System Profiler), and ether setenv boot-device to it or just boot the path directly. Brad points to this article, which does an adequate job explaining (though it does get the OpenFirmware key combo wrong, in a rather obvious way: you can't hold the F key down twice). I didn't actually check before the 10.5 upgrade on my Powerbook, but it sure seems like the “Startup Disk” System Preference exists and lets me choose my properly formatted (FireWire 400-connected) external drive with a 10.4 backup of the MacBook Pro's installation on it…

Yes, there is a “recover from Time Machine” choice somewhere (in the 10.5 install media, I think?), and maybe it works, but I'm certain this works and I actually know what it's doing under the covers. It's simple. Simple is good for backups of last resort.

And yes, , I just tested this and it's what you needed to do when you couldn't get your just-rsync backup disk to work.

Update: At some point, tacked on the bit about needing to not ignore owners at the bottom of his post; I'd only gone back to it and skimmed down to compare notes on rsync(1) flags since my initial reading, so I missed that. Also, bless(8) is apparently not necessary for him or most of the people doing what he suggests, but I still think it's a Good Idea, after reading the documentation. It can't hurt and it might help.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*