Recovering data from bad disk - Case study

May 09, 2006 03:13

Your system was working fine yesterday. Today when turned on your computer it says some 'bad disk' error and can't boot. What went wrong ?
  • Improper shutdwon because of power failure ?
  • Recently disk used to make strange noise and today h/w went bad ?
  • Some strange reason ...
How can all the sectors go bad at once unless i hit it with a hammer ?
Even if few sectors are gone bad, it must be possible to recover remaining data !?
ddrescue - data recovery tool by GNU
    Homepage: http://www.gnu.org/software/ddrescue/ddrescue.html
    It copies data from one file or block device (hard disc, cdrom, etc) to another, trying hard to rescue data in case of read errors.
    Ddrescue does not truncate the output file if not asked to. So, every time you run it on the same output file, it tries to fill in the gaps.
    The basic operation of ddrescue is fully automatic. That is, you don't have to wait for an error, stop the program, read the log, run it in reverse mode, etc.
    Automatic merging of backups: If you have two or more damaged copies of a file, cdrom, etc, and run ddrescue on all of them, one at a time, with the same output file, you will probably obtain a complete and error-free file. This is so because the probability of having damaged areas at the same places on different input files is very low.
This is how i was able to recover a disk

Attach 2 Disks D1) Disk to be recovered: /dev/hda (40GB disk) D2) New disk: /dev/hdb (Must be >= 40 GB i.e.,sizeof disk to be recovered) Boot the system from a live CD (or some way which doesnot use the above two disks) Prepare and get the 'ddrescue' binary into this environment Download code from ddresuce site Compile it. (While linking use -static if live CD doesn't have all supporting libraries) Have a cup of coffee while ddrescue is busy recovering your data to new disk.
ddrescue will keep reporting statistics like how many good/bad sectors it saw. ./ddrescue /dev/hda /dev/hdb All good data from D1 has been transfered to D2. D2 is replica of D1 except for few bad sectors in D1 which did not get copied to D2.
Now it should be possible for you to mount D2 and see your valuable data.
If you are unable to mount D2, it is very likely that sectors containing partition metadata went bad.
Try recovering partitions with info given at Recovering deleted partitions - Case study
Previous post Next post
Up