Section 14.1. How It Works


14.1. How It Works

The following sections outline a procedure you can use to anticipate and conduct a full recovery of a Mac OS X system, without needing to install the OS first. The sequence is generally the same as on other platforms.

A great time to test this procedure is right when you receive your new Mac, and you haven't yet put any data on it.


You first prepare for the recovery:

  1. Attach backup media to the system.

  2. Back up the important metadata.

  3. Back up the operating system with a native utility.

Then, when bad things happen, you perform the recovery:

  1. Boot from alternate media.

  2. Partition, and format the new root disk.

  3. Restore the operating system information.

  4. Set the system to boot from the new root disk.

We'll start with a general overview and then move on to a concrete example of the procedure. As with any backup method, your safety net is only as good as your last backup, so scheduling backups and testing your recovery procedures are important.

14.1.1. Preparing for a Bare-Metal Recovery

This procedure can use any external hard disk drive as a backup medium. Examples include a FireWire or USB storage device of sufficient capacity to hold a full backup. Depending on your storage requirements, even an iPod makes an excellent alternative. Another option is to use a Mac laptop in FireWire Target Disk Mode, assuming it has a FireWire port. Finally, you can also use an NFS share from any Unix-type server. While the USB and FireWire drives may be excellent options for an individual user, the NFS option is usually the best for a data center. Unfortunately, an SMB share will not work, because SMB drivers aren't available from the install CD console that we will be using during the recovery, but more on that later.

To enter Target Disk Mode, click on Apple MenuSystem PreferencesStartup DiskTarget Disk Mode.... Alternatively, hold down the T key while booting the Mac laptop. Hook up a FireWire cable between the laptop and the system youre backing up. The laptop then acts as an external FireWire drive.


After you've attached the external backup disk, you need to collect the information necessary to format the replacement disk before you restore data to it. Save the output of diskutil list, pdisk device dump (on PowerPC units), and mount t hfs to files on your backup disk that you can reference during recovery.

As of the time of this writing, Apple has recently released the first Macs built around Intel x86 CPUs instead of PowerPC CPUs. If you happen to be running an Intel-based Mac, you will not be able to use pdisk, and fdisk will not supply information on the disk you're running it from, but more on that later.


It's also a good idea to save Open Firmware variable settings to a file with nvram p, just in case your NVRAM gets zapped along with your root disk. And for good measure, keeping a copy of the output from System Profiler handy means you have fairly complete documentation of your system's hardware and software setup available. (Launch the System Profiler application by going to the Apple Menu and selecting About This MacMore Info..., then use FileSave to create a profile of your configuration.)

Now it's time to back up the data you'll use to recover the operating system. There are several native backup utilities from which to choose, but for this procedure, we use one specific to Mac OS X named ditto. With Mac OS X 10.4 and later, you could conceivably choose tar instead of ditto. However, we're going to use an install disc as the boot device during recovery, and the compression tools employed by tar (gzip or compress) aren't available there, whereas ditto features have built-in PKZIP compression. In order to save space on the backup medium and for compatibility with older versions of the OS, the example procedure detailed later in this chapter uses ditto for backup and recovery. For more on backup utilities native to Mac OS X, see Chapter 3.

14.1.2. Performing a Bare-Metal Recovery

When the day comes to use your backup for a system recovery, either as practice or because something terrible has happened, your first task after replacing any failed components is to boot up the system. The easiest choice for this is to use the same optical media you would use to install a fresh copy of Mac OS X, and that's the approach we take in our example.

Once the machine has booted up, it's time to partition and format the new disk using the diskutil and pdisk output you saved during backup. For this you can use the diskutil partitionDisk command.

Restoring the data is pretty much the opposite of backing it up: use ditto to decompress and unpack the archive files. If you need to restore your Open Firmware setup, use nvram f filename. Finally, once all the data has been restored, use the bless command to configure the system to boot from the new disk.




Backup & Recovery
Backup & Recovery: Inexpensive Backup Solutions for Open Systems
ISBN: 0596102461
EAN: 2147483647
Year: 2006
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net