Thursday, October 29, 2009
Data Recovery Tips and Tricks
Here's some tips on using ddrescue:
1. Always use a log file
2. Start ddrescue like this the first time:
ddrescue /dev/sda1 /dev/sdb1 logfile.log (sda1 will be the C: drive, sdb1 will be
the replacement drive.) Do not get them backwards in order.
3. Once you notice a ddrescue struggling to read through bad sectors, kill the job.
In Linux, you can try pkill ddrescue, or ps -ef | grep ddrescue . Find the PID or
process id number. Then type kill -9 pid, i.e. kill -9 1234.
4. Rerun ddrescue using the -i and -s switches, i.e. ddrescue -i75G -s125G logfile.log
(start copying 125GB after the first 75GB). The -s switch is size or amount to copy.
The -i switch is the initial position to copy from. You want to copy as much of the good
parts of the drive as quickly as possible, so skip the bad parts if you can.
5. Once you have most of the drive copied, then kill the job and type the following:
ddrescue -n -d /dev/sda1 /dev/sdb1 logfile.log . Ddrescue will read the log file and
only copy what it hasn't copied. With the above command, it will try to trim the bad
sectors and recover as much data as it can without recovering the bad sectors.
6. You can then try to recover the bad sectors, but this will be VERY time consuming and
problematic. Rerun ddrescue like so: ddrescue -r3 -d /dev/sda1 /dev/sdb1 logfile.log .
7. You can then rerun ddrescue using the -n -d switches to get anything you missed, but
by this stage it is likely you've recovered all the data that you are going to get.
Google "man ddrescue" and "info ddrescue" for more information about the program.
If you need to recover an audio CD, you can use cdrdao. Ddrescue is only good for recovering digital media. Audio CDs use a different format and can't be read by ddrescue. If the audio CD has scratches, you will get skips using a normal CD or DVD burning program. I have built a GUI front end for ddrescue that works on Windows. If any one wishes to use it, you can email me at jbmoore61 [AT] gmail[DOT]com. I hope to have it on sourceforge.net or some other convenient web site shortly.
Using an Ubuntu liveCD is easiest. Just boot your system with the liveCD. Under accessories, choose terminal. Then type sudo su. The prompt will change to # which means you are essentially root. Then type dhclient to grab an IP address, or you can click on the adapter icon in the upper righthand corner of the screen. Then type apt-get update ; apt-get install ddrescue. Choose y if prompted and ddrescue will be installed into the ramdisk. You can then use ddrescue to recover and copy your Windows drive to the new hard drive. Try to get a replacement drive that is the same size as your old drive. If you get a larger drive, you may have to run qpartd or gpartd to make the new copy use all of the new drive's disk space.
Labels: ddrescue cdrdao
GNU ddrescue 1.11
Copyright (C) 2009 Antonio Diaz Diaz.
Links to this post: