Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.6: Create networkable and copyable Time Machine backups System 10.6
This is a Snow Leopard update, and a bundling of, the hint on using Time Machine on a networked AFP volume and this comment about creating a bootable Time Machine backup.

Issues addressed:
  1. I have a Time Machine backup disk in my office, and I want it to be encrypted in case of, for instance, theft of the disk.
  2. I have a shared Time Machine server at my office, and I don't want others to access my backups.
  3. I want to move my Time Machine backup to another disk (a larger one, or simply to have an extra copy)
  4. I want it to be easy :-)
The solution (as has been pointed out before) lies in using disk images for backups, with a little bit of magic to make it work.

I use two shell scripts to make the magic happen. The first, mkBackupImage (view source) creates such a disk image, optionally encrypted. The resulting image, when at the top of a disk (remote or local), is recognized by Time Machine for automatic backups, and for partial and (when booted from a Snow Leopard installation DVD) full system restores.

As long as the system keychain has the password for the image, Time Machine will automatically back up to the image, keeping the contents safe. For a full system restore from an encrypted image, the image itself has to be decrypted first, which is the task for the second shell script, decryptSecureBackupImage (view source).

You can also download both scripts in one zip file, if you prefer. After downloading, or saving from source, save the scripts somewhere, and then run them in Terminal.

Testing: These scripts have been tested in the following ways:
  • Automatic backup to and and full restore from an image on a local disk.
  • Automatic backup to and full restore from an encrypted image on a local disk.
  • Automatic backup to and partial restore from an encrypted image on a remote disk.
[robg adds: I haven't personally tested these scripts.]
    •    
  • Currently 2.86 / 5
  You rated: 4 / 5 (28 votes cast)
 
[17,182 views]  

10.6: Create networkable and copyable Time Machine backups | 8 comments | Create New Account
Click here to return to the '10.6: Create networkable and copyable Time Machine backups' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Create networkable and copyable Time Machine backups
Authored by: everkleer80 on Oct 16, '09 08:06:31AM

This comment is not directly related to this hint but it has to do with using sparseimages for bacup. I have a drive connected to my iMac that I share on the network to backup my MacBook and backup my iMac locally to it. For both backups I use sparsebundles and both computers backup fine, and the MacBook restores from it fine, but the iMac (which, again, is connected locally) does not use the image when I click Enter Time Machine; to restore on my iMac I have to manually mount the image and choose Browse Other Time Machine Backups.

I am not using the new UUID method of identifying backup images, so maybe I should try that to see if it corrects the problem (currently I have the backup named "<MachineName>_<MACAddress>.sparsebundle" which I guess is an older method of creating sparsebundle backups.) I did have the same problem on Leopard too.



[ # ]
10.6: Create networkable and copyable Time Machine backups
Authored by: mantrid on Oct 17, '09 02:09:47PM
I have a similar setup. The great advantages are that it allows backups to be copied easily without having to deal with hard linked directories inside TimeMachine backups since the backup is just a disk image, and those backups can be stored securely in a remote location because of the encryption.
As long as the system keychain has the password for the image, Time Machine will automatically back up to the image, keeping the contents safe
This is probably obvious, but it might be worth mentioning that if the password is stored in the system keychain to allow automatic backups, a password won't be required to get into the backups if someone has access to the system. For example, a sensitive file no longer on your system but stored on the backup will be accessible if both your computer and backup are stolen together.

[ # ]
10.6: Create networkable and copyable Time Machine backups
Authored by: zegor on Oct 17, '09 06:35:28PM
This is probably obvious, but it might be worth mentioning that if the password is stored in the system keychain to allow automatic backups, a password won't be required to get into the backups if someone has access to the system. For example, a sensitive file no longer on your system but stored on the backup will be accessible if both your computer and backup are stolen together.
That is certainly true. But not much of a concern (for me). If they steal both my computer and the backup disk then I am compromised anyway - direct physical access to my computer compromises all the non-encrypted contents on that computer.

Stealing the backup disk in addition exposes past material (as well as the current computer content), but for me the real disaster is the integrity breach of all my current stuff becoming available t to the thief. The incremental loss of integrity of material that is on the backup but deleted from the computer does not worry me too much in face of the main disaster.

But the point is well taken.

[ # ]

10.6: Create networkable and copyable Time Machine backups
Authored by: kopf on Oct 17, '09 07:52:48PM

Is there a way to copy an existing local (non-sparsebundle) TM backup to a newly created image, so that TM will continue with incremental backups instead of starting from scratch?



[ # ]
10.6: Create networkable and copyable Time Machine backups
Authored by: zegor on Oct 25, '09 12:16:05AM

It can be done in three steps in the terminal:

1) Create an image (optionally encrypted) of the same size as the time machine hard disk. You can use the script from http://www.macosxhints.com/article.php?story=2009092822584146 or simply copy and execute the relevant parts of it:

mkBackupImage.sh -p <path to the disk image file> -s <size of the disk being copied>

2) Mount the new image:

open <path to the disk image file>

3) Use asr to make a block copy of the hard disk to the image:

sudo asr --source /Volumes/<hard disk> --target /Volumes/Time\ Machine\ Backups/ --erase

E.g. assume the source harddisk is named TimeMachine (size 370 GB), the computer is named MyMac and you want to create the image in /Volumes/NewTimeMachine (another disk):

mkBackupImage.sh -p /Volumes/NewTimeMachine -s 370g
open MyMac.sparsebundle
sudo asr --source /Volumes/TimeMachine --target /Volumes/Time\ Machine\ Backups/ --erase

Caution:
Make sure your asr copy is done by block copy (not file copy). See man asr.

Testing:
I have tried this in a minor way. Created a time machine backup, backed up to it a few times, then followed the above hint, and then shifted the time machine to back up to the NewTimeMachine disk. TIme machine will mount the disk image, and back up to it.

Bugs:
When restoring from the image, one has to (1) mount the image (open the image file in the finder), (2) control-click the time machine in the dock, and (3) pick "Browse other time machine disks..."



[ # ]
10.6: Create networkable and copyable Time Machine backups
Authored by: JPry on Oct 17, '09 11:08:25PM

One small note: when I used the script, I noticed that line 128 has "choe" instead of "echo". Nothing serious is missed, but some people may be confused when they see "command not found" in the middle of the instructions on what to do after creating your new image.



[ # ]
10.6: Create networkable and copyable Time Machine backups
Authored by: patmuk on Oct 19, '09 03:58:11AM

Not directly intended by this tip - but is it somehow possible under 10.6 to use a sparse bundle on the same harddisk (or another partition) with time machine?
Currently I have a similar setup: I have two partitions, the first one serving as the system partition and the second one for the time machine backup and unimportant files like my downloads and my music.
The second partition gets backed up via SuperDuper! to an external drive at work.
The main reason for this back up is to have the ability to "go back in time" at any moment. A drawback is, that I have to manually delete old backups in order to reclaim space on my second partition.
So, any chance to use a local sparse bundle disk instead?



[ # ]
10.6: Create networkable and copyable Time Machine backups
Authored by: patmuk on Oct 19, '09 03:58:11AM

Not directly intended by this tip - but is it somehow possible under 10.6 to use a sparse bundle on the same harddisk (or another partition) with time machine?
Currently I have a similar setup: I have two partitions, the first one serving as the system partition and the second one for the time machine backup and unimportant files like my downloads and my music.
The second partition gets backed up via SuperDuper! to an external drive at work.
The main reason for this back up is to have the ability to "go back in time" at any moment. A drawback is, that I have to manually delete old backups in order to reclaim space on my second partition.
So, any chance to use a local sparse bundle disk instead?



[ # ]