miniclone for Mac OS X
utility script to create minimal bootable clone of active root
particularly useful for making bootable utility flash drives

table of contents


background

Mac OS X's installation media includes a number of very useful tools for resetting passwords, diagnosing hardware issues, cloning drives, copying data, checking and repairing filesystems, managing disks, and even conducting forensics if you're so inclined. However, there are a number of situations in which these tools just don't work, notably when a whole-disk encryption (WDE) product is used to protect mobile data, such as on laptop systems. In this case in particular, a secondary bootable system drive is required with support for the underlying sector-level encryption. In general, though, it's really handy to be able to turn a USB drive into a bootable volume that'll boot up any Mac and be useful for fixing a wide range of issues.

The following page contains a script for creating a bootable clone of the currently running system on any target media, including thumb drives, flash drive, or other internal or external bootable media. Naturally, this is most useful with a keychain thumbdrive.


usage

WARNING: MINICLONE WILL IMMEDIATELY ERASE THE CONTENTS OF THE VOLUME YOU AIM IT AT, AND IT WILL NOT CHECK IF THIS IS OKAY. USE AT YOUR OWN RISK.

miniclone is a shell script that either expects to find a volume called "miniclone" or expects to be provided the full path (for example, "/Volumes/miniclone") of a volume it can erase and replace with a minimal installation of Mac OS X from the active boot drive. ONCE AGAIN, MINICLONE WILL IMMEDIATELY ERASE THE CONTENTS OF THE VOLUME YOU AIM IT AT, AND IT WILL NOT CHECK IF THIS IS OKAY. USE AT YOUR OWN RISK.

It is worth noting that Windows XP's GUID support is incomplete at best, and does not totally support multiple partitions on a single drive. In situations where you want to use a multi-partition device, I recommend using an MBR partition table, and rEFIt (link below) to allow Mac OS X to boot off the MBR-partitioned device. Just installing rEFIt is enough; no need to configure it.

In order to run miniclone, either invoke it as root or just type: sudo miniclone /Volumes/target


Replace "target" with the volume name of an already formatted and mounted partition you want to use. miniclone will figure out its device file, wipe it clean with a new HFS+ partition, and start replacing it with a subset of the contents of your boot drive, as specified in the script. Using a text editor, it's very easy to modify miniclone to add or remove applications, directories, or services.


files

miniclone is licensed under the GPL with one caveat: if you change the directories and files cloned in the existing foreach statements, I consider this a configuration change and you don't need to send back your changes.


known issues


credits


links


contact info

this page compiled by
peter bartoli (
pgp key)
and last updated 9/19/09 at 37,000 feet
never ever fly delta airlines! they suck!