Structure and Interpretation of Computer Programmers

I make it easier and faster for you to write high-quality software.

Monday, October 29, 2007

Verify your backups

Apple shipped Mac OS X 10.5 this weekend, and three of the features are Time Machine, dtrace, and improved CHUD tools. Time Machine, dtrace, CHUD tools. iPod, mobile phone, web browser. Time Machine, dtrace, CHUD tools.

To spell that out in long hand, it’s very easy now to see how various features in the Operating System behave. And in the case of Time Machine, we see that it walks through the source file system, copying the files to the destination. When I last gave a talk to OxMUG on the subject of data availability, it was interesting to notice how the people who had smugly put their hands up to indicate that they performed regular backups became crestfallen when I asked the second question: and how many of you have tested that backup in the last month?

Time Machine is no different in this regard. It makes copies of files, and that’s all it does. It doesn’t check that what it wrote at the other end matches what it saw in the first place, just like most other backup software doesn’t. If the Carbon library reports that a file was successfully written to the destination, then it happily carries on to the next file. Just like any other backup software, you need to satisfy yourself that the backup Time Machine created is actually useful for some purpose.

posted by Graham Lee at 20:04  

Thursday, May 3, 2007

Bye bye data, hello…the same data

Of course it happens to everyone, and yesterday evening it happened to me…my home directory became inaccessible. What seems to have happened is that the filevault image containing my ~ became corrupted upon unmounting (though notably, I didn’t do the ‘recover space’ thing the last time I logged out before the failure, so it should just have been a straightforward unmount). so the simplest recovery route was to delete the user, re-create it then recover my data from the backups. I don’t keep backups of the Library area so lost a few preference files, and of course have had to trawl around my email looking for licence keys and the like.

For the moment I’ve set up the replacement user without Filevault, and am using encrypted disk images for specific data I’d rather keep thus protected. This makes backups harder – I keep my backup drive unencrypted as it doesn’t come out with me, so I now need to come up with a script to backup my home dir except for the encrypted images, mount the images and back up the content, then unmount them. This means that the backup will need to be manually triggered so that passwords don’t have to be kept anywhere…or I write my own backup tool, which uses passwords stored in a keychain kept outside the target user account; and I need to make sure that keychain is also recoverable ;-).

A lot of my data was completely unaffected – work stuff is typically stored in subversion on their servers (as well as another local copy on my work laptop), my email is all on remote servers, my calendar is served by thaesofereode.info and so on. There are some improvements I could make – I could probably use an LDAP server and abxldap to remotify my contact list, and thaesofereode.info offers subversion hosting which I’m currently not making use of. But it happens that next Tuesday, I’ll be talking about data security at the Oxford Mac Users Group, so I will expand on this tale in full and gory detail ;-). St. Cross College, Tuesday 8th May, 7:30 pm.

Update 20070503T1653Z+0000: actually, things look a little more serious than simply a trashed sparseimage:

mabinogi:~/Desktop leeg$ hdiutil attach OmniDazzle-1.0.1.dmg
load_hdi: timed out waiting for driver to load
load_hdi: timed out waiting for driver to load
load_hdi: timed out waiting for driver to load
load_hdi: timed out waiting for driver to load
load_hdi: timed out waiting for driver to load
[…]
2007-05-03 15:41:35.535 diskimages-helper[718] ERROR: unable to load disk image driver – 0xE00002C0/-536870208 – Device not configured.

Good news is that when that gets fixed, my old homedir will start working again. Bad news is: um, it looks fairly messed up to me :-(

posted by Graham Lee at 13:30  

Powered by WordPress