On some occasions, it’s useful to be able to make a full backup of a system on an ad-hoc basis. One example would be making a complete backup of a Mac’s boot drive before sending it in to Apple for a repair, as Apple may swap out or erase the Mac’s existing boot drive as part of the repair process if their tools indicate a drive problem.
When I’ve needed to do this, I’ve used DeployStudio for this task. The reason why is that DeployStudio includes the ability to do the following:
- Create an asr-ready disk image from a Mac’s boot drive containing the OS and all other data.
- Restore the disk image to an available volume on the same or different Mac, and setting the target volume to be bootable.
These capabilities were originally designed to allow monolithic images to be created from one Mac for distribution to other Macs, but these capabilities also allow DeployStudio to create on-demand backups of a Mac’s boot drive. For more details, see below the jump.
By default, new installations of DeployStudio include the following two workflows:
Name: Create a master from a volume
Description: This simple workflow enables you to select a volume (HFS, NFTS or EXT format) in order to create a disk image. The disk image will be stored automatically on the DeployStudio repository.
Name: Restore a master on a volume
Description: This simple workflow enables you to restore a disk image (HFS, NFTS or EXT format) located on the DeployStudio repository to a local disk or volume.
I cloned both workflows and edited the new workflows to make it more clear that these workflows were used for backup and restore tasks.
Name: Create Backup System Image
Description: Use this workflow to make an image of a system prior to working on it.
Here’s how I have the workflow set up in DeployStudio.
Name: Restoring System Image From Backup
Description: Use this workflow to restore a backup image of a system.
Here’s how I have the workflow set up in DeployStudio.
Note: The Skip Apple Setup Assistant option is checked because I’ve found that DeployStudio will remove the /private/var/db/.AppleSetupDone file when restoring. This file suppresses the Apple Setup Assistant, so checking this option is needed in order to add the .AppleSetupDone file back.
Creating a backup
To create a backup using the Create Backup System Image workflow, use the following procedure:
1. Boot to DeployStudio
2. Log into DeployStudio
3. Select the Create Backup System Image workflow.
4. Select the Mac’s boot drive.
5. Name the disk image something unique and distinctive.
6. Click the play button to start the workflow.
7. Go get coffee or do other work while DeployStudio is creating the disk image.
8. Once the backup is complete, click the Quit button to reboot the Mac and exit DeployStudio.
Restore from backup
To restore a disk image to a drive using the Restoring System Image From Backup workflow, use the following procedure:
1. Boot to DeployStudio
2. Log into DeployStudio
3. Select the Restoring System Image From Backup workflow.
4. Select the desired disk image.
5. Select the desired target drive.
6. Click the play button to start the workflow.
7. Go get coffee or do other work while DeployStudio is restoring the disk image.
8. Once the restore is complete, click the Quit button to reboot the Mac and exit DeployStudio.
9. When the Mac boots up, the DeployStudio Finalize process runs then automatically reboots the Mac.
10. After the second reboot, log into the Mac and verify that the restore was successful.
Note about drive space
An important thing to account for when using DeployStudio for backups like this is ensuring your DeployStudio server has sufficient disk space available on the DeployStudio fileshare for the backup disk images. When DeployStudio is capturing an image, here is the process it uses:
- The data on the target drive is written to a read/write sparsebundle disk image. This disk image will be the same size as the amount of data that you’re trying to back up.
- Once the data on the target drive has been completely written to the sparsebundle disk image, the sparsebundle disk image is converted to a compressed read-only disk image.
- Once the compressed disk image has been fully created, the sparsebundle disk image is deleted.
- The compressed disk image is scanned by asr for later restoration.
- The restore-ready compressed read-only disk image is uploaded to the DeployStudio server.
Because the sparsebundle disk image is not deleted until after the compressed read-only disk image is ready, at a point in the process, you’re going to need available space for not only the full size of the data you’re backing up, you’ll also need available space for the full size of the compressed disk image.
If there is available space on the drive being backed up, or on another hard drive connected to the Mac being backed up, DeployStudio will prefer to use local disks for creating the sparsebundle disk image and compressed disk image. However, if there is not sufficient space available on the Mac being backed up for the disk images to be created, DeployStudio will mount a temporary network fileshare from the DeployStudio server and do the necessary disk image creation using the available space on the DeployStudio server itself.