Update: On August 31 I updated this post with a more detailed description that should always work
I was among the 1M people who downloaded the newest version of Mac OSX operating system 10.7 “Lion” in the first 24 hours but to make sure my productivity doesn’t suffer I initially installed it on my wife’s personal Mac. She doesn’t use it so much these days anyway. After some trying out I finally installed Lion on my Mac this past weekend. With two Macs on Lion I found a cool way of keeping all our backups on a single Time Capsule drive. Here's how I did it.
Note: This is a technical post for Mac OSX Lion users. I wrote it because I didn’t find a single easy-to-digest how-to for configuring secure Time Machine backups on Lion. Sorry for this technical stuff, I just hope it's useful for some :-
My setup: 2 Macbook Airs and one Time Capsule
So we have 2 Macbook Airs at home – one belongs to my wife and one to me. We want to be able to:
1) Backup both Airs wirelessly to the same Time Capsule
2) Make sure we have enough space on the Time Capsule drive for our backups and also some other media files
3) Make the backups encrypted for maximum safety
New Lion’s Time Machine is good and secure... but needs tweaking.
The new Time Machine in Lion can encrypt your backup drive, but only if it’s connected via USB. If it’s a Time Capsule, no dice. Second thing, the Time Machine backs up until the disk is full. If we have two Macs we want to make sure we have space for each other’s backups and we have room for some media files. For that we need to create “virtual, encrypted backup hard disks called sparse bundles” on the Time Capsule for each of our Macs. Here’s what I did:
Step 1. Enable FileVault2 on the Mac
I was using FileVault on the Mac so after I upgraded to Lion, I went to “System Preferences” and had to first disable what Apple now calls “Legacy FileVault” and decrypt my user account. It takes a few minutes, once done I went ahead and enabled the new FileVault on the entire hard disk. Again, took some time to complete. Now my entire disk on the Mac is encrypted.
Step 2. Prepare Encrypted backup disk (a.k.a. “Sparsebundle”)
I found this hint
here - now let me upgrade it to the Lion. Just do the following:
1. Figure out the name of your computer (and make sure it doesn’t contain spaces).
This is important. Go to “Sharing” in “System Preferences” and rename your computer (mine is called “Jane”, don’t ask…)
Also find out the address of your main ethernet card (in the case of my Macbook Air it's the address of my wireless card) - go to "System Preferences", "Network" and click on your wireless card and go to "Advanced" and at the bottom of the page you'll see your "Wi-fi address"… or just type in the Terminal:
ifconfig en0 | grep ether
The result for me was: 04:0c:ce:dc:a6:78
Keep this address for later.
2. Open disk utility and create a new volume image on your Time Capsule drive like this:
a) Save As: ComputerName_EthernetAddress (without ":")
In my case: Jane_040ccedca678
(Computer name: Jane, Ethernet address without ":" is: 040ccedca678 - make sure to find out yours in the previous step)
b) Name: ComputerName (in my case: Jane)
c) Custom size, I chose 300 GB for now.
d) Format leave as it is, meaning: Mac OSX Extended (Journaled)
e) Encryption: choose 128-bit - it's fast and it's really secure
f) Partitions leave as it is, meaning: Single Partition, Apple Partition Map
g) Choose "sparse bundle disk image" - important.
The cool thing is that the virtual disk will be small at the beginning and will only reach it's size after many backups. I don't store too much media on my Air, so 300GB should be good for now. Initial backup was just 115GB. Plenty of room for the incremental backups now.
Size of the Sparsebundle file/disk can be increased later with one terminal command if you need that :-)
This way on our 1TB Time Capsule we have 600GB for backups and 400GB for media files (home videos and stuff).
Disk Utility asked me for a password. I chose one and saved it in the keychain. After the format, the disk has been mounted. Worked great so I unmounted it.
3. Open “Keychain Access” application (you'll need to provide your admin password here) and move the password from your personal keychain (usually called "login") to the “system” keychain.
Step 3. Do the first backup and you're set.
When Time Machine asks you to point the drive to backup to, just point to your Time Capsule drive where the encrypted sparsebundle resides. And go with the first backup!
Do your first backup. It will take a while, do it before going to sleep. Now the Time Machine will back up to this "Sparsebundle" encrypted virtual hard disk every time and will not take over your entire Time Capsule disk. The Time Machine will rename your disk to just "ComputerName.sparsebundle" - don't worry about it. It will find it for backups later.
Optional Step - schedule backups manually.
If you’re like me and you don’t like Time Machine backing up every hour, you can do an optional step – download
TimeMachineEditor application and schedule your backups. This is how I do it:
TimeMachineEditor will disable your official Time Machine backup scheduler as it triggers backups by itself. My backups are being run 3 times a day and I think it’s more than enough.
Congratulations. You have secure backups on your Time Capsule in Lion and you’re set to be even more productive on your Mac. Good luck!
Also, an even better backup routine also has two sets of backups (ideally one local backup, one remote).
Nevertheless, a very helpful article on how to set this is up.
I'm trying to backup my Macbook to a new 4th gen Time Capsule and Time Machine just keeps creating and mounting a new disk image while ignoring my homemade encrypted one. I've tried both the Wi-Fi and ethernet MAC-addresses in the name to no avail. Even tried dropping the whole MAC-address altogether, but that doesn't work either, Time Machine just adds number one (1) the the name of sparse bundle it is creating and happily goes on backing up my files onto that volume.
I'm trying to create a 750GB volume to my home folder in Time Capsule. Time Machine creates sparse bundle named like: computername.sparsebundle, mounts that volume and starts backing up.
Any ideas what might be happening and what can I do to resolve this issue?
This has to be some kind of bug, don't you think? There can be no reason why Time Machine would not accept an encrypted sparse bundle at first but then after renaming its own creation and putting MAC-address to the end of the name for file you created it suddenly does.
Perhaps this could even be considered a some kind of security issue; malware is sitting on the system, detects a first time Time Machine activity and stops the process at the right point, creates its own encrypted image with pre-determined password and waits... until there is a need to use the backup and then starts to demand something (money most likely) to allow user to access those backups. Far fetched maybe, but still.
But anyway, thanks for the tip and help solving my issue - maybe you should include the problem and the solution as a footnote since I can hardly imagine this affects only the two of us.
hdiutil resize -size 500g MyFile.sparsebundle
and it will now be resized to max size of 500GB - of course it will not occupy so much space until you put so much stuff in it (so many backups for example). Hope it helps.
thanks :)
ManuelaMac_0026bb1a57ee_0026bb1a57ee.sparsebundle
ManuelaMac_0026bb1a57ee_MACADDRESS.sparsebundle
ManuelaMac_MACADDRESS.sparsebundle
However, in all these cases time machines keeps creating a new file
what am i doing wrong? thank
however, when mac starts backing up... time machine keeps creating a second bundle called ManuelaMac.sparsebundle and the original remains on the time machine. so the second is not just a renaming but a completely new file (without the proper setting)
Are you sure you put also just your computer name in (b)? If you did follow all of my instructions here and it doesn't work for you, I'm really sorry for that. Can't trouble-shoot it anymore as it worked in all of my cases. Did you try to delete the automatically created file and hit backup again? It also didn't help?
Anyone had the same issues?
I'm really sorry Riccardo, hard to say why it doesn't work for you....
Best regards
Daniel
First, thanks for a great post. It is much easier and quicker using Disk Utility for the sparcebundle than the terminal.
I had the same problem: Either TM would just create a new sparcebundle on its own, with a _1 name, OR TM would just be trying to access the volume, stalled in some sort of loop.
What works without the renaming fix:
1. Create new Disk Image directly on the TC using Disk Utility.
2. Save As : Computername_MacAdresse(Lan).sparcebundle (field a in guide)
3. Name: 'Time Machine Backups' (field b in guide)
Presto!
1. Do your first backup (or second or third, as long as the sparsebundle file has not already increased to a size greater than the limit you are setting out to achieve.
2. Temporarily switch off time machine (so it doesn't try and backup while you're doing this.
3. A sparsebundle is really a folder which Finder pretends is file (a bit like the programs in your applications folder). The maximum size for a sparsebundle file is stored in an xml file named Info.plist which lives inside the .sparsebundle folder.
4. If your time capsule disk is mounted (double click on it in finder) you can very easily access this from the command line.
a. Open the terminal (In Applications==>Utilities
b. type in
sudo nano /Volumes/time-capsule/tim.sparsebundle/Info.plist
[ yours will have a different volume and sparsebundle name obviously ]
c. If you have a 1TB time capsule the file will look something like this
<?xml version="1.0" encoding="UTF-8"?>
<plist>
<dict>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>band-size</key>
<integer>8388608</integer>
<key>bundle-backingstore-version</key>
<integer>1</integer>
<key>diskimage-bundle-type</key>
<string>com.apple.diskimage.sparsebundle</string>
<key>size</key>
<integer>998057361408</integer>
</dict>
</plist>
d. change the final number (998057361408 in this example) to a smaller number
(409600032768 will make it limited to 400GB)
e. press control-o to save and then control-x to exit
f. copy this file to its bckup counterpart... type in:
sudo cp /Volumes/time-capsule/tim.sparsebundle/Info.plist /Volumes/time-capsule/tim.sparsebundle/Info.bckup
e. close the terminal.
5. Turn on time machine again and relax.
It works !
I'm experiencing an issue related to permissions on the disk.
On a mac with multiple users the volume for the backup, once mounted, has only privileges for the user that has created the sparseboundle. This affects usage for other users on the same machine: their backup are done by the system, but they can't restore from them.
Hope we don't have to recover our data all that often, though :-)
this is a great tutorial and very helpful. I am trying to set it up but I am stucked on the step in which you move the password from your personal keychain to the “system” keychain. I don't get which one I should move coz I see more than one. Hope you have the answer ;) Thanks in advance...
Cheers...
Horacio
Thanks anyway for the great tutorial, since I got my TC I wanted to set up the size of the backups...
cheers,
H
Cheers!
Rolf
Let's say I were to make a limited and encrypted time capsule backup in the way you described. Would there be any problem if I were to do a clean install of my Mac and try to restore from this backup? Would the encryption confuse it in any way?
just wanted to say thanks :)
I just tried your suggestions and it seems to have worked great as Time Machine saw the disk image and it is currently using it for the first backup - I have reformatted and reset it to factory defaults before doing this.
On a side note, do you know if / how much the encryption affects the backup speed?
Thanks!
Vito
I cannot see the Time Machine drive in disk utilities, or how do I connect using USB (I would prefer network actually)?
To timbo.phillips
I got very far using your method, but not quite there. After your step f (copying the file, this is what I'm getting in the terminal:
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
When I turn the time machine back on , I'm getting an error saying the disk is already in use. Am I missing something?
Thanks. D
I upgraded my MB with SSD drive and this method did not work anymore. Turns out that most probably in some point update the Lion's Time Machine started using the ethernet's MAC-address instead of WiFi, at least on this type of machine. Luckily someone pointed out this possibility earlier in the discussion above, surely I would not have guessed this myself.
Also I'd like to point out that my wife's iBook, running latest version of venerable Leopard , is backing up to the same Time Capsule also using this very method. So it seems to be backwards compatible.
forget the: "find out the address of your main ethernet card"
instead do the following:
step 1: run a backup to your time capsule.
step 2: as the backup tmp file is created (you will find the file in your time capsule HD).
right click it and go to "show package content" in it you will find the following
files:
com.apple.TimeMachine.MachineID.bckup
com.apple.TimeMachine.MachineID.plist
Info.bckup
copy them (cmd +C)
step 3: stop the backup (click on the time machine icon and then choose "stop back up"
from the drop down menu. + go into your time capsule and erase the tmp.
step 4: now go over the same stages as mentioned by mr liwinski . in stage 2: section a
"save as:" use your mac name (no ethernet or wifi add ons).
after the file is created. go to your time capsule HD, find the new image file, right
click it and go to "show package content". paste into it the 3 files copied in step
2.
step 5: now run your backup again. it should ask you if its ok to use the image file you created.
What does appear is "iMac-Dave.sparsebundle " and within that "Time Machine Backups"
I had the same problem: each time TM created new sparcebundle.
Issue was resolved by changing mac-address and name to "Time machine backups"
Which one is really useful I don't know but at the end it works.
Thank you.
If I want to use this procedure for 60 Mac, do you have a solution to protect the time machine image?
Shouldn't one be able to look somewhere and see the limit for the Laptop's TM bundle?
Basically:
- Create an (encrypted) disk image
- Move it to the location where you want it
- Mount it
- sudo tmutil setdestination /Volumes/{mounted-disk-image}
- Backup now
1) Set up a new time machine backup from scratch using the Time Machine UI. Click the encryption check box for an encrypted backup.
2) Initiate your first time capsule backup.
3) Wait until the backup has started and left the initialization phase so that you can see how many MBs that have been backuped.
4) Stop the backup (using the time machine ui) and turn Time Machine off.
4) You should now have the "machine_name.sparsebundle" file in your /Volumes/Data directory.
5) Open a terminal and type (for a 500GB max size):
"hdiutil resize -size 500g /Volumes/Data/machine_name.sparsebundle"
6) Then do:
"chflags uchg /Volumes/Data/machine_name.sparsebundle/Info.*"
7) Turn Time Machine on and restart the backup!
Step (5) limits the size of the bundle to 500GB and will take a few minutes to finish. Step (6) is really important as apparently time machine tries to reset the size to the maximum each time when restarting and by changing the permissions of the Info.plist file you will stop it from updating the size.
Not the one you suggest to pick in Wi-fi address you suggest to pick from system preference. It's not the same and just don't work if you pick this one.
Is it possible for you to update the instructions?
Thanks
First thank you for this post, very clear and interesting, I am going to try to bring you back my two cents.
I was more than happy when I got my Time Capsule but quickly disappointed when I started to use it with Time Machine. Selecting the maximum size of a backup storage was not possible!! Why a so logical parameter could not be set?? Good news is that I am not alone to be struggled with!!
I have recently upgraded my two Machines, one Imac and one MacBook pro to Mountain Lion.
I have these two machines + my son’s MB saved on my Time Capsule this is the reason why I first selected the method described by timbo_phillips (October 2011) to try to preserve previous backups.
I did a first test with my MB, the backup went well but at the end it prompted saying that the checking was not correct and that a new full backup was required :-(.
So by the way I removed the old sparsebundle file and started with your method creating a 300G image file. I checked the info.plist file and it was set to 307200032768 which looked good to me.
I started then Time machine, called for a new backup and here is the bad thing: TM updates the info.plist file to the full Time Capsule size!!
This is tracked in the system logs: Resizing backup disk image from 307.2 GB to 2 TB
I restarted everything using another method described here (similar to your method),
http://www.youtube.com/watch?v=Nq7mSizqUSI&feature=watch_response
And I got the same issue.
Finally I did it one more time following your method but in addition I did what Stefan was suggesting on August the 13th but I only set the info.plist file to locked (this lock can be displayed in the properties of the file)
From the terminal: chflags uchg /Volumes/Data/machine_name.sparsebundle/Info.plist
Started again a new backup and here the mounted image is set to a capacity of 307 G and info.plist did not change.
This time logs are showing up a message from TM: Could not resize backup disk image (DIHLResizeImage returned 35) which is great for me
I did a first backup, and at the end info.plist was not modified, I could access to the backup from Time Machine and capacity of the mounted image is still 307Go.
Now I keep my fingers crossed waiting to reach the 300G of backup!!
Cheers