hard disk drive troubles
Par Benoît Dejean le vendredi, 30 mai 2008, 18:08 - Lien permanent
On May, 8th, my ibook fall from the table and hit the ground 40cm below. I saw it fall, saw it instantly poweroff :/
Disk reconstruction began. It's a 60GB disk, with a 58GB reiserfs /. It could still boot but i got read errors everywhere and reiserfsck reported 81 corruptions. I have a one month old backup, that's not good enough. I needed a live cd in order to copy the disk, run badblocks and eventually try to fix it if it's not totally destroyed. The best i could get was an Ubuntu 5.04 live cd. I pluged in my 250GB USB disk. I then started to run badblocks (with the wrong blocksize...). I then tried to dd it, but that was taking ages. I was looking for GNU ddrescue but it was not present. I wondered a bit, but then realized that the / was writable: spent 10 minutes looking for a valid ubuntu mirror, apt-get update g++, grabbed the ddrescue sources, compiled it. I would have extracted the disk if i could found the righ screwdriver (thank you Apple).
48H later: at first ddrescue found 130MB of dead blocks out of 58GB. The damaged blocks are located around 20GB, 40GB, and 60GB, so clearly, the heads hit the platters. After trimming errors, it's down to 30MB. reiserfsck has this very nice '--rebuild-tree' which scans the whole partition, rebuilds the filesystem and reports which entries are damaged, using real filenames. This is so great because you then know which files are damaged (and there's of course a lost+found).
...
After days of dd_rescue and badblocks, i recreated the fs and copied back all my data. I had the nice idea to double-check the copied data and found a lot of corruption. I took my laptop to the nearest apple center, and got it back 2 days later (May, 28). 220€ later, my laptop was back with a new 120GB harddrive and OS10.4 on it (although i asked for a clean drive). Booted ubuntu, partionned the disk, formated in ext3 (with 256B inode, ready for ext4), installed yaboot, copied my rescued /. Tada ! it booted OK. I eventually found that some /var files were damanged which made apt unhappy.
FIN
Commentaires
Running fsck on a drive with known defective sectors is a sure recipe for disaster. In fact, writing anything to a drive you are trying to rescue data from is a bad idea. dd_rescue to a known working drive should be the very first command to run.
How old is the iBook? They've had sudden motion sensors since mid-2005 to supposedly prevent this sort of thing
I've never run fsck on the harddrive. I've rescued it, then run fsck on the image. If you had read more carefuly, this is exactly what i did: dd_rescue then worked on the image.
My ibook is mid-2004 :/
Its also possible that drive wasnt destroyed physically, but hdd electronics. I saw many similar problems with barracudas with destroyed electronic by shitty power adaptors(like LC&C, codegen, rubikon, deer, tracer). And the simplest way to restore data is to buy new eletronic, and sometimes is possible to mirror it(without errors) after disabling DMA.
salut, sympa ton blog ! vraimen agréable de lire teq billets. pour en revenir àce billet, parfois certaines parenthèses en disentv bien + que le reste dz la phrase: although i asked for a clean drive