PDA

View Full Version : dd_rescue for copying hard drives with bad sectors



don999
08-22-2009, 05:03 AM
I don't know if this has been covered before, but knoppix includes the program dd_rescue which is really a brilliant program for copying/imaging hard drives with bad sectors.

dd will give you lots of trouble when it encounters bad sectors, usually truncating the output or exiting when it gets a read error.

dd_rescue is much more forgiving.

"dd_rescue" without parameters will give you a list of command line parameters. Note that the command line syntax is much different from dd.

For example, "dd_rescue /dev/hda /dev/null" will copy from /dev/hda to /dev/null . I like to use this as a read test to see if an entire hard drive can be read.

I had a failing hard drive whose LBA sector 0 was completely unreadable. dd wouldn't even want to look at it. With dd_rescue I was able to get most of the good data off of this drive. Interestingly, knoppix 5.1 wouldn't even give me a /dev/hda in the device directory as it couldn't read the partition table in LBA 0 and kept retrying ad infinitum. I tried knoppix 3.9 and knoppix 6.0.1 and they would give me a /dev/hda even if LBA 0 was bad.

don999
08-22-2009, 05:09 AM
Oh yeah, when you're using "dd" or "dd_rescue" be very careful with your parameters.

They don't call dd "disk destroyer" for nothing!

From wikipedia: It is jokingly said to stand for "data destroyer" or "delete data", since, being used for low-level operations on hard disks, a small mistake, such as reversing the if and of parameters, may accidentally render the entire disk unusable

The best way to "practice" with dd is with a system with non-critical data on it.

Clinton
08-24-2009, 04:54 PM
Thanks, don999. Another (http://www.knoppix.net/forum/viewtopic.php?p=61576) good thread on dd_rescue and here's a useful page (http://paulski.com/zpages.php?id=1913).

krishna.murphy
01-31-2010, 01:03 AM
Thanks, don999. Another good thread on dd_rescue and here's a useful page.

Hey-

Sorry if I'm being dense, but can I burn something in the second link's zip to a CD, maybe the .IMG file? The utility there can make a bootable CD if I am understanding properly.

mifronte
03-10-2010, 09:21 PM
I am using Knoppix 6.2.1 and dd_rescue to try and recover files from a failing hard drive with bad sectors. The drive has one NTFS partition and is in an external USB enclosure. In Windows XP, I can access the drive until a bad sector is read and then the drive becomes unresponsive. It is like the drive was disconnected from the USB port.

So running Knoppix 6.2.1, I was hoping to recover any files that are still readable with dd_rescue. However, once dd_rescue reads a bad sector, the hard drive appears to become unresponsive (unmounted?) and dd_rescue starts scrolling a lot of errors. I have allowed dd_rescue to run for well over an hour scrolling errors. Should I allow dd_rescue to complete or is there some way of forcing the hard drive from being unmounted?

krishna.murphy
03-11-2010, 03:54 AM
I am using Knoppix 6.2.1 and dd_rescue to try and recover files from a failing hard drive with bad sectors. The drive has one NTFS partition and is in an external USB enclosure. In Windows XP, I can access the drive until a bad sector is read and then the drive becomes unresponsive. It is like the drive was disconnected from the USB port.

So running Knoppix 6.2.1, I was hoping to recover any files that are still readable with dd_rescue. However, once dd_rescue reads a bad sector, the hard drive appears to become unresponsive (unmounted?) and dd_rescue starts scrolling a lot of errors. I have allowed dd_rescue to run for well over an hour scrolling errors. Should I allow dd_rescue to complete or is there some way of forcing the hard drive from being unmounted?

It sounds to me like a pretty severe situation; I've been advised by others in this forum to use "Hiren's Boot CD" in the past when Knoppix was insufficient. If you search it out on the web you can download it (the best place to get it, back when I needed it, was a Thai server) and there are a LOT of great tools on there. I ended up using a version of Microsoft's disk scanning utility "chkdsk" (no additional license required) that worked a lot better than the one in XP to recover from errors on my NTFS partition. Look for other posts within these fora for more details, or elsewhere on the web.

Krishna :D

don999
04-13-2010, 10:50 PM
Often times, a really bad drive will stop responding. You can abort the dd_rescue program with a CTRL+C. Sometimes I will attempt to skip over a really bad area by aborting and then retrying with the skip option. Can't remember the exact syntax off the top of my head but running dd_rescue with no parameters should tell you.

You can also install GNU ddrescue; using the synaptic package manager from the knoppix GUI which is a dd_rescue like program (but spelled differently).

The GNU ddrescue program will use a log file and skip over LARGE bad areas on the drive automatically, then come back later and try to fill in the gaps. Works really well and can often recover more than dd_rescue which is geared to make a single pass. However, nothing can recover from a drive that is really stuffed up...

tollhaus
05-10-2010, 08:32 PM
I am in the process of using DD_rescue to copy anything left on a hard drive that crashed to a new hard drive that I bought. I've got it running alright, but I'm wondering about the next step:

If/when anything copies to the new hard drive, how do I get it off of this new hard drive. The only thing I really need are some pictures that were on the old one when it crashed.

Needless to say, I am very new to Linux. I have a coworker who is willing to help with specifics, but does not have time to do the research. He helped me get it running after I showed him this forum and is loaning me his copy of knoppix.

krishna.murphy
05-28-2010, 10:26 PM
I am in the process of using DD_rescue to copy anything left on a hard drive that crashed to a new hard drive that I bought. I've got it running alright, but I'm wondering about the next step:

If/when anything copies to the new hard drive, how do I get it off of this new hard drive. The only thing I really need are some pictures that were on the old one when it crashed.

Needless to say, I am very new to Linux. I have a coworker who is willing to help with specifics, but does not have time to do the research. He helped me get it running after I showed him this forum and is loaning me his copy of knoppix.

It sounds like you need to check out the man-page for dd_rescue - just open LX-terminal (little black tv-screen icon on lower left) and type:
man dd_rescueOr, you can search the web for the same string. Basically, you can limit how much gets copied in the first place; if you need to get rid of anything afterwards you can use PCman (file-folder icon next to the LXterm icon) or
rm -rf /the/path/and/name-to-delete in the terminal window.

Cheers!
Krishna :mrgreen:

kl522
12-25-2012, 01:17 AM
I did not have to use dd_rescue until I have a crashed hard disk.

Then I start reading about dd_rescue. But it's confusing because there is another program call ddrescue around. The one included in Knoppix is dd_rescue, while some of the docs in the net talks about ddrescue ( the GNU version of dd rescue ). The ddrescue Debian package is called gddrescue, but the program name is ddrescue.

I would actually recommend to use ddrescue instead of dd_rescue. 'ddrescue' with a log file makes it interruptable and resumable. And if there are bad sectors, it can retry the bad sectors at some other time when you cool off the hard drive or if you take it out from the freezer. :)