2

I'm using OSX Snow Leopard and a FileVault protected home directory for my user. To backup my HDD I make a live rsync backup of a whole filesystem to external drive:

rsync [parameters] / /Volumes/Backup

I skip backuping the FileVault sparsebundle located in /Users/.username. Additionally I backup the decrypted contents of my home directory (I'm logged in while doing this):

rsync [parameters] /Users/username /Volumes/Backup/Users/username

So that on the backup drive I have the full copy of the file system, but instead of FileVault sparsebundle I have the decrypted contents of my home dir (I can live with the dangers of unencrypted backup).

I want the backup to be usable in case of a primary hard drive crash, so I also mark the drive as bootable. I can boot from this external drive, no problems here. However, I am unable to log into my account - I'm getting this error message:

You are unable to log into the FileVault user account at this time Logging in to the account failed because an error occurred

My guess is OSX assumes it's a FileVault account, so it looks for the FileVault sparsebundle - and, since it's not there, it fails.

My question is - what modifications should I make to the backup filesystem after rsync to mark my user as a standard account that is not using FileVault? What file/files to change?

1 Answer 1

3

I haven't tested this, but I think you can "normalize" the account by removing its HomeDirectory attribute.

sudo dscl -f /Volumes/Backup/var/db/dslocal/nodes/Default / -delete /Local/Target/Users/fvtest HomeDirectory

(with your username instead of "fvtest".) Note that the attribute names are rather confusing; there are two relating to the home directory, one in XML format giving instructions for mounting it, and the other giving its unix path once mounted:

$ dscl . -read /Users/fvtest | grep HomeDirectory
HomeDirectory: <home_dir><url>file://localhost/Users/fvtest/fvtest.sparsebundle</url></home_dir>
NFSHomeDirectory: /Users/fvtest

With a network account, HomeDirectory would instead have information about mounting the home directory from a server. With a normal (local, non-filevault) account it's not there.

BTW, if you look in the user files (in /private/var/db/dslocal/nodes/Default/users/username.plist), you'll see the same values but under different attribute names: HomeDirectory=home_loc, NFSHomeDirectory=home.

3
  • dscl has to be run with sudo, apart from this, worked like a charm, thank you! Commented Jan 16, 2012 at 20:29
  • Ah, I was assuming the entire backup ran as root. I'll edit my answer to make it explicit. Commented Jan 16, 2012 at 20:37
  • I've published my backup script in case anyone has similar needs - gist.github.com/1622842 Commented Jan 16, 2012 at 20:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .