10.6: Let Time Machine backup File Vault while logged in

Jan 27, '10 07:30:00AM

Contributed by: m4x

Snow Leopard only hintIt bugs me that Time Machine won't backup my encrypted home folder, provided by File Vault, while I'm logged in. I rarely log out of my account, and that makes Time Machine pretty useless in my opinion. I wanted some way to create a backup while logged in.

I'm more concerned about my laptop being stolen than my backup drive, since it's sitting in my closet, attached to my AirPort Base Station. So the fact that the backup won't be encrypted with this hint is no big deal for me. As a side effect, it makes single file restoring much easier. (One caveat being that Time Machine complains that it can't find the original location of the file, since it treats the home folder as a disk and not a path on the startup disk. You need to manually select that.)

To sum it up: I need my home folder to be encrypted. I don't need my Time Machine disk to be encrypted (but I'm sure someone can come up with a way to accomplish that, too.) Read on for the how-to...

First, make sure your Time Machine setup is functioning properly. This hint assumes you have XCode installed, as it uses Property List Editor; you'll need to change the process a bit if you use a different property list editor.

You will need to manually edit the preference file for Time Machine, adding the ID string of your File Vault disk to the list of disks to backup. You can't do this from within System Preferences or otherwise. One way of finding the ID string of the disk is to open com.apple.finder.plist, located in your user's /Library/Preferences folder, and look for the FXRecentFolders item.

One of the entries should contain the name of your home folder (your login name) together with an entry called file-data. If it doesn't, you need to close the plist and visit your home folder in Finder. This will make it a 'recent folder,' and then you can check the file again.

The value of _CFURLAliasData inside file-data is the string we need, including the enclosing < and >. Copy this to the clipboard.

Now, disable Time Machine from within System Preferences, make a back up of com.apple.TimeMachine.plist, located in /Library/Preferences, and then open the original file in Property List Editor. Select IncludedVolumes and click Add Child. Select type Data and paste the string you copied earlier.

(If IncludedVolumes doesn't exist, select Root and click Add Child. Name the new entry IncludedVolumes and make it type Array. Then do the above.)

Check that the path to your home folder isn't listed in any of the items ExcludeByPath, ExcludedVolumes, or SkipPaths. Save and quit the editor.

Select Back Up Now from the Time Machine menu bar extra to start an initial backup. Note: You may already have a backup of your image file (located in the hidden folder /Users/.username), in which case you will have duplicates. You might want to exclude this from your backup.

When browsing your backup, your unencrypted home folder will be on the Computer level, alongside your startup disk. Not where it normally is -- under /Users -- since it is treated like a regular disk.

[robg adds: While this hint was submitted as a 10.6-only hint, I suspect it will also work in 10.5. However, I can't confirm that, so I left it marked as submitted.]

Comments (17)

Mac OS X Hints