A tale of a harddisk failure & ensuing data rescue

The older i grow the more i appreciate the soothing confidence a terminal can instill. No matter how fucked up your system is, as long as you can get a terminal running all is not lost.
Those problems i had with my ibook which i blamed on overheating issues? I was a little off there. I still believe that my ibook was running too hot and that resetting pram and nvram resolved these problems, but the inexplicable slowdowns after longer periods of use were apparently caused by a slowly failing harddisk drive. Last sunday my ibook went into its last massive slowdown before its harddisk kicked the bucket.
Smart as i am, i didn’t have any decent backups. Following potential-massive-dataloss protocol i panicked and started googling around, leading me to this mac os x hints article in which we learn how to dump an image from a corrupt harddisk drive using dd on a mac. This article shall henceforth be known as the most valuable piece of text on the whole wide web.
In this article you’re walked through rescuing your failing harddisk by means of dd using its noerror- and sync-options to make it continue after read errors and pad input blocks to the specified input block size.
Problem in my case was that the failing harddisk was my bootdisk and i didn’t have any backup-installations of os x lying around on external drives either (what do you expect from a guy who doesn’t even backup his home directory properly?). So i booted from the mac os x tiger install dvd (press c during startup to boot from internal optical drive) and found a terminal with all necessary commandline tools there. What a pleasant surprise. I tried to determine the mount point of my internal hdd with

disktool -l

but apparently the drive was so far beyond rescue it wasn’t even listed there. While trying to boot in verbose mode before (press cmd-v during startup to boot in verbose mode) i had noticed that my boot partition was disk0s3, so i figured the bootdisk name should be disk0 (disknames have the format diskX, partitions have the format diskXsY). I gave it a try with something like

dd bs=512 if=/dev/disk0 of=/Volumes/External2/img.dmg conv=noerror,sync

and my ibook started happily copying away. About ten hours later i checked the resulting disk image and to my own astonishment it not only mounted, but appeared to be almost complete.
Overall i’m just glad that i could rescue (most of?) my data and i felt almost relieved that finally there was an easily reproducable error when i brought the ibook into repairs. I just wonder what people who are a little less savvy with computers can do in a situation like this, aside from suffering a massive data loss?

# Jun 30, 2005 2 comments

2 Responses

  1. [...] I’m currently doing a disk copy from the internal drive to a partition on the external, using a similar command to what Christoph used when his drive died: dd bs=512 if=/dev/disk0s3 of=/dev/disk1s3 conv=noerror,sync [...]

    Pingback by Jeremy’s Little Corner Of The Web… » Hard disk crash (again) on Aug. 11th, 2005, at 15:21 #

  2. Hard disk crash (again)

    My PowerBook decided it wasn’t going to recognise the hard disk on Tuesday morning… a PRAM reset (on Dad’s recommendation) seemed to fix it, but there were disk errors. Thankfully, no mechanical problems!
    I tried a number of times to fix it u…

    Trackback by Jeremy's Little Corner Of The Web... on Aug. 11th, 2005, at 16:25 #