Home > DeployStudio, Mac administration, Mac OS X, macOS > Using DeployStudio to create full backups of a Mac’s boot drive

Using DeployStudio to create full backups of a Mac’s boot drive

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:

  1. Create an asr-ready disk image from a Mac’s boot drive containing the OS and all other data.
  2. 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.

Screen Shot 2017 01 19 at 3 42 41 PM

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.

Screen Shot 2017 01 19 at 3 42 46 PM

 

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.

Screen Shot 2017 01 19 at 3 35 50 PM

Here’s how I have the workflow set up in DeployStudio.

Screen Shot 2017 01 19 at 3 47 03 PM

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.

Screen Shot 2017 01 19 at 3 47 14 PM

Screen Shot 2017 01 19 at 3 47 28 PM

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.

Screen Shot 2017 01 19 at 3 35 50 PM

4. Select the Mac’s boot drive.
5. Name the disk image something unique and distinctive.

Screen Shot 2017 01 19 at 3 56 05 PM

6. Click the play button to start the workflow.
7. Go get coffee or do other work while DeployStudio is creating the disk image.

Screen Shot 2017 01 19 at 4 01 13 PM

8. Once the backup is complete, click the Quit button to reboot the Mac and exit DeployStudio.

Screen Shot 2017 01 19 at 4 50 01 PM

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.

Screen Shot 2017 01 19 at 3 35 57 PM

4. Select the desired disk image.

screen-shot-2017-01-20-at-8-10-38-am

5. Select the desired target drive.

screen-shot-2017-01-20-at-8-11-00-am

6. Click the play button to start the workflow.
7. Go get coffee or do other work while DeployStudio is restoring the disk image.

screen-shot-2017-01-20-at-8-13-22-am

8. Once the restore is complete, click the Quit button to reboot the Mac and exit DeployStudio.

screen-shot-2017-01-20-at-8-19-02-am

9. When the Mac boots up, the DeployStudio Finalize process runs then automatically reboots the Mac.

Screen Shot 2017 01 20 at 8 20 59 AM

10. After the second reboot, log into the Mac and verify that the restore was successful.

Screen Shot 2017 01 20 at 8 45 51 AM

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:

  1. 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.
  2. 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.
  3. Once the compressed disk image has been fully created, the sparsebundle disk image is deleted.
  4. The compressed disk image is scanned by asr for later restoration.
  5. 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.

  1. Steve Yuroff
    January 20, 2017 at 5:52 pm

    Rich- ever had to troubleshoot where “Make Master From a Volume” logs as executed properly, but on the DS server, the DMG remains in /Masters/tmp ? DS server has 7TB open, so it’s not a space issue.

    • January 20, 2017 at 7:03 pm

      I’ve seen that behavior periodically occur when a previous DeployStudio server was using an external RAID for storage. I didn’t do a lot of troubleshooting; I just moved the disk image out of the tmp directory when needed.

      As part of fixing a separate issue, I changed from using the external RAID to an SSD hosted on a PCI card on this DeployStudio server. Along with fixing the main problem, the problem with the uploaded image sticking in /Masters/tmp also went away.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: