Recovering Files off of a Mac
February 14, 2010 Leave a comment
I recently helped a friend migrate from a 10+ year old Mac to something a little more modern, a new iMac in this case.
Migrating was pretty easy, most of the documents were in a standard format so everything copied over nicely, I used the excellent USB 2.0 Universal Drive Adapter from NewerTechnology to hook the old drive to the new Mac and most files were copied in minutes.
Email on the other hand was an issue. The mail client used was Microsoft Outlook Express for the Mac. Such a beast existed a long, long time ago, I remember checking it out in 2000 and preferred to use Entourage because there was an OS X migration path for that, Outlook Express never made it off System 9, and it was running under the Classic Environment on that Mac (Mac OS 9 in-a-box).
In the process the Mac had to be disconnected from the mains which caused it to lose its clock setting reverting back to 1969 (the internal battery was long dead) and Outlook Express freaked and reset its database hence losing all the email (Outlook Express like Entourage stored its emails in a proprietary database). Of course there was no back and I neglected to do one since we were migrating off the machine.
So after some experimentation with deleted file recovery software I came across the interesting idea of reading the drive in raw format, ie opening the device name as a file (‘/dev/disk4’ in this case) and reading my way across the drive. I wrote a little script which scanned for email headers and pulled the emails off the drive as it came across them.
There were a few wrinkles though: Even though it was able to identify 30,000+ emails based on headers, a second pass knocked that down to 10,000+ once I checked for valid content. Since Outlook Express was running in the Classic Environment, the end of line separator is a carriage return as opposed to a new line. And the way I decided an email ended was to look for non-ascii characters or the start of a new email.
Once I got al the emails out, I wrapped them up in an mbox formatted file and Mac OS X Mail was able to import it in just under a minute.