Saturday, May 8, 2010

Cloning a Mac hard drive

I googled the following phrase, launch carbon copy cloner from the command line, and the very first result was this entry from Mac OS X Hints. I adapted it to use the technique while booting from a Mac OS X install disk.

The install disk contains Terminal.app. Boot from the install disk, launch Terminal, and have an external drive connected to the Mac. Then, run the following on the command line:

/usr/sbin/asr -source /Volumes/Macintosh\ HD -target /Volumes/External\ Drive -erase

The above is all one line, so take care.

"Macintosh HD" represents the actual hard drive on the Mac, which is the source disk. "External Drive" represents the volume on the external drive, which is the target disk. The utility, "asr," is the Apple Software Restore utility. The last option, "erase," completely overwrites the target disk and "blesses" it: meaning, you will be able to boot from the image you create.

In the above command line entry, a single dash is used. This may vary depending on which operating system version you're using. In Tiger, for example, it's a single dash; In Snow Leopard, it's the more conventional two dashes.

You have to use the install disk because both the source and target disks will be unmounted during the block-for-block copy that will take place.