General Info

By: Scott Doenges - Revised: 2006-05-25 devin

Introduction

An overview of Apple Software Restore (ASR) including system requirements, how it works, setup, and common issues.


What is ASR?

Apple Software Restore (ASR) has long been Apple's method of installing uniform system and application software to large numbers of Macs. Early on it was used to restore sick Macs to a "factory" state, and it was later developed as a more general software restorer for Apple software packages. Some educational institutions employed it as a mass-deployment solution for open-access computer labs, but it didn't have the best track record as far as reliability.

Why not use "ASR for OS X"?
When Mac OS X first came along, Apple made a fairly feeble attempt at making OS X ASR imaging possible, using unique and hard-to-find OS 9 versions of Disk Copy and the ASR application itself, calling it "ASR for OS X". These special applications were only available through an AppleCare Pro membership or (unofficially) through your Apple SE.   Needless to say, the process of creating an OS X ASR image with OS 9 applications left a lot to be desired - the apps were buggy, poorly documented, and didn't completely support OS X, so images didn't always work as expected.

Why use ASR?
However, with the advent of Mac OS X 10.2.2, a true version of ASR for OS X was finally made available to the public as a command-line tool (meaning it can only be run in OS X's Unix shell). This version of ASR has some very handy new features, such as the ability to do network restores using HTTP.


ASR can quickly restore entire labs, or individual staff machines, to a default state of your own creation.  You can create images of straight Mac OS X, or Mac OS X with Classic, or straight Mac OS 9.

Apple kindly included a fairly comprehensive man entry for ASR in 10.2.2, so you can get a good idea of how it to use it by typing "man asr" at the command line.

For those of you with an innate fear of using the command line, don't worry - Mike Bombich has already adapted Carbon Copy Cloner 2.1.1 to automate most of the command-line work associated with creating OS X ASR images, using a nice GUI. I discuss using CCC 2.1.1 to create ASR images on this page.

System Requirements

Any Mac capable of running Mac OS X 10.2.2. In order to create images, you must have 10.2.2 client or server, but the drive you're imaging can have any version of the Mac OS (although these instructions are specific to imaging Mac OS X).

How does it work?

ASR's strength is that it has the potential to perform block-level copying (rather than file-by-file copying) to restore an image to a target drive , so restores are generally performed very quickly. It also utilizes "stretchable" disk images, so the size of the drive in your original source Mac (i.e. the Mac you'll be creating your ASR image from) has no impact on the clients you'll be restoring the ASR image to (although your clients' drives obviously must be large enough to fit the contents of the ASR image).

For the most part, Mac OS X ASR images are universal, so an ASR image that you create on a 1.25 GHz Dual-processor G4 will run fine when restored onto a Blue & White G3. However, it's generally a good idea to create your image on the newest model that you intend to restore your images to, just in case there are any hardware-specific items that your newest clients may need.  Exceptions to this include Apple's DVD Player software, which is not installed on some hardware due to licensing issues.

Setup and Steps

Setup
For easy testing purposes, it's helpful to partition the drive on your "Source Mac" (i.e. the Mac you want to make ASR images of) into two or three partitions (or use separate physical drives) - one as the "Source" partition, one as a blank "Target" partition to test your images on, and one as an "Admin" partition that you'll boot from to image the "Source" partition.  If you've got a FireWire drive to boot from and save your ASR images to, you'll only want to partition it in half - a "Source" partition and a "Target" partition.

Alternately, if you've got a FireWire drive to boot your Macs from, you could use two unpartitioned Macs to test your images - one as the Source and one as the Target.

Keep in mind that you cannot boot Blue & White G3s from FireWire drives.

Step 1: Set up your Source Mac
Once you've set up your partitions, install Mac OS X 10.2 on your Admin partition (or FireWire drive), as well as on the Source partition.  Leave the Target partition blank.  Boot from each partition and use Software Update to apply any necessary system updates (and remember that your Admin partition/drive must have 10.2.2 in order to utilize ASR - but the Source partition doesn't need to have 10.2.2).  You can install whatever apps you want on the Admin partition, since it will just be your work space to do the image creation/restoration.

Now boot from the Source partition and install/setup all applications, system preferences, dock items, users, privileges, etc., that you want your users to have when they log in.  This includes setting privileges to applications/ directories that you don't want your users to be able to access.  Set it up exactly how you want it to appear to your users.  This may require quite a bit of time and testing, depending on how restrictive you want to be.


If you've got a DHCP server on your clients' subnet, you can further automate the restore process by setting your Source Mac to obtain an IP address via DHCP, then create DHCP server entries for each of the clients you intend to restore.  Thus your restored clients would boot up and automatically get an IP via DHCP, without making you manually enter an IP on each client.

Remember that if you set a static IP address on your Source Mac, that IP would get distributed to your restored clients, which would obviously cause problems.

Steps 2 & 3: Cleanup, Create and Restore an ASR image
You've got several options for creating and testing an ASR image of your Source Mac. Each of the sections below describes how to create an image with each different method, and perform a test-restore of your image to make sure all is well:
  • Disk Copy/Command-line
    • Clean up your Source Mac, create an ASR image using either Disk Copy or the command line, then use the command-line to restore your ASR image onto another volume.
  • Carbon Copy Cloner 2.1.1
    • Carbon Copy Cloner's GUI automates nearly all of the steps in creating and cleaning up ASR images.  However it can't perform efficient block-copy restores or restore via AFP/HTTP.
  • imageJaguar .75a
    • imageJaguar is a shell script that semi-automates the ASR image cleanup, creation and restoration process.  This is an alpha release, so it's still a bit rough around the edges, but it works quite well.
Step 4: Distribute your ASR image
You've got several options for deploying your ASR image via the command line.
  • using a bootable CD or DVD.  You could create a bootable OS X CD/DVD (detailed instructions on doing this can also be found on Mike Bombich's page), which contains your image(s).  Using a CD may be tricky if your compressed image is larger than 600 MB - earlier versions of ASR had the ability to let you swap CDs during a restore, but I have not tested this with Jaguar's ASR.  Blank DVDs, which have a capacity of 4.7 GB, may be able to fit one or two full ASR images in addition to the system software.
  • using a FireWire drive. This may not be ideal since you would have to manually boot each machine from your drive to perform ASR restores.  This is achieved with the following Terminal command:

PROBLEM WITH CODE WRAPPING

sudo asr -source /<SourceASRimage.dmg> -target /Volumes/<Target volume> -erase

  • using an AFP network volume.  This is achieved with the following Terminal command:

PROBLEM WITH CODE WRAPPING

sudo asr -source afp://user:password@server.name.com/share/image.dmg -target /Volumes/<Target volume> -erase

  • using an HTTP (i.e. web) server.  It allows you to simply enter an HTTP address for your ASR image, which may be useful if you're unable to use an AFP volume to distribute your images.  Keep in mind that your image may not be entirely safe from prying eyes unless you restrict access to your image on your web server.  This method is achieved with the following Terminal command:

PROBLEM WITH CODE WRAPPING

sudo asr -source http://server.name.com/image.dmg -target /Volumes/<Target volume> -erase

using NetInstall. You could (theoretically) modify a NetInstall image (normally used to boot clients and perform OS X software package installs over a network) to run a script which restores an ASR image to a local volume.  Why not use NetBoot?  Unfortunately NetBoot uses a "swapfile" on machines' local drives, so you can't perform an erase-restore on a NetBooted Mac.

Distribution ideas
As a quick way of getting a sick Lab Mac back in service, I created an ASR image of one of our OS X Macs and deleted a certain "trigger file" from the image, whose absence would trigger our OS X distribution software, Radmind.  After restoring the Mac with ASR, the Mac reboots, notices that the trigger file is missing, and connects to the Radmind server, which then brings the Mac completely up to date.  A similar concept could be used with other OS 9 or OS X distribution software.

Other ideas...

Common Issues

  • Some people have reported problems using Jaguar's Disk Copy to create disk images larger than 2 GB, but I believe this problem may be due to the 2 GB limit imposed on AFP file servers.  You may run into this problem if you try to create your ASR image onto a network volume.
  • Dealing with the ByHost preferences files, if necessary.  Some applications, such as iTunes, iPhoto, Screensavers and Desktop pictures, use preference files whose names contain the hardware address of the machine they're created on (these are kept in "~/Library/Preferences/ByHost").  This obviously creates a problem when you're trying to mass-distribute customized settings for these applications.  As of this writing, the only workaround for this issue is to use a shell script that appropriately renames these files on system startup.  More information on this script can be found here.
Other issues...