toxicsoftware.com

RANDOMIZE USR 0

toxicsoftware.com header image 2

FileVault Corruption

August 7th, 2005 · Comments · Uncategorized

Sometime in the last couple of days (possibly the last week) the sparse image that FileVault stores my home directory within got corrupt. I noticed it yesterday when checking out Objective C files from subversion that ended up containing fragments of XML instead of the Objective-C source code they should have contained.

It turned out the XML was fragments of the NetNewsWire subscription plist (which NetNewsWire seems to save to disk pretty regularly). Something was definitely up. I logged out and booted up from my Tiger install DVD and performed a disk check using Disk Utility. The FileVault image was damaged (beyond repair) and the volume it was kept on (not my System volume) was damaged too.

I couldn’t repair the sparse image without repair the volume it resided on and paradoxically could not repair the volume without first repairing the image!

My last backup about two days ago had failed too - I thought rsync was just being flakey on 10.4 (it was core dumping) and stupidly didn’t pay it much mind. If I perhaps had taken the time to investigate then I might have realised something was up. Because my backup was incomplete I had no choice but to try and repair the disk image. I copied it to an external firewire drive (Lacie Pocketdrive) and deleted the original. That allowed Disk Utility to repair the volume but I couldn’t repair the sparse image without corrupting it (I only tried to repair the sparse image after copying it back to the original volume).

I didn’t have enough room to turn off FileVault so in the end I logged in as a different user (without FileVault), created my own sparse image and copied the contents of the corrupted FileVault sparse image to my new image.

I then used NetInfoManager and the terminal to try and manually disable FileVault. I then copied the contents of my backup image into the home directory.

Because I used the Finder (as a different user) to perform the copy (I wanted to make sure resource forks were copied and although cp under 10.4 should work fine with the extended attributes I didn’t want to take the risk) I had to manually recursively reset the file ownerships and then copy the dot prefixed hidden file at the root of my user directory.

I now seem to have a working user directory again. I have lost (but used .Mac syncing to get a copy of) my Mail.app preferences. I have also lost my TODO list (kept in OmniOutliner) which ended up containing a fragment of a NetNewsWire subscriptions list. Luckily I kept that in subversion and have only lost a little bit of content. I decided to trash the subversion working directories just in case, but everything was safely checked into the repository and I don’t think I have lost anything.

Everything outside of my FileVault sparse image is also fine (I keep ~/Music, ~/Movies, ~/Pictures and my source code/Xcode intermediate directories outside of FileVault with just symbolic links in their places).

Conclusion:

1) Always investigate a backup failure immediately. 2) Rethink FileVault. I’ve been using FileVault for almost a year with no problems. By moving large/often accessed files outside of FileVault I thought I was managing to get the best of both worlds. I am not sure now whether I am going to re-enable FileVault or not. Right now I’m coming down on the side of not re-enabling it (let’s see if I notice a performance boost in the next few days). 3) Implement a better backup strategy so that if the worst happens I can go back if I have to.

Things that saved my butt: 1) Keeping my home directory on a different partition to my System volume. 2) Having an admin user account ready to use for maintenance tasks. 3) My Lacie Pocketdrive. 3.5) Target Disk Mode (didn’t use it actually, but I easily could have) 4) A copy of the Tiger Install DVD (and the ease in which you can use the Install DVD to repair/investigate a volume). 5) .Mac sync - without this I would have lost my Mail configurations. Not the end of the world but a pain in the butt. 6) Keeping my important documents in subversion. 7) The ability to disable FileVault on a user account by using NetInfo Manager (and by manually copying data from the Sparse Image into the user directory). 8) Disk Utility. Although the disk repair function isn’t as great as (say) DiskWarrior the ability to create disk images and use the disk restore function between real volumes and disk images is fantastic.

Tags:

Viewing 6 Comments

 
close Reblog this comment
blog comments powered by Disqus