dd_rescue (also known as ddrescue) is a program that copies data from one file or block device to another, it is a tool to help you to save data from crashed partition.
It tries to read and if it fails it will go on with the next sectors, where tools like dd will fail. If the copying process is interrupted by the user it is possible to continue at any position later. It can copy backwards.
Install dd_rescue or ddrescue
If you are using Debian / Ubuntu Linux, type the following command to install ddrescue:
# apt-get install ddrescue
If you are using RedHat /Fedora /CentOS Linux, type the following command:
# yum -y install ddrescue
Or directly download ddrescue from official GNU web site.
Please note that Debian install ddrescue binary as /bin/dd_rescue and other distribution as /usr/bin/ddrescue
How do I use dd_rescue (ddrescue)?
To make exact copy of /dev/sda (damaged) to /dev/sdb (make sure sdb is empty) you need to type following command:
# ddrescue /dev/hda /dev/hdb
Naturally next step is to run fsck on /dev/sdb partition to recover/save data. Remember do not touch originally damaged /dev/sda. If this procedure fails you can send your disk to professional data recovery service. For example if /home (user data) is on /dev/sda2, you need to run a command on /dev/sdb2:
# fsck /dev/sdb2
Once fsck run, mount /dev/sdb2 somewhere and see if you can access data:
# mount /dev/sdb2 /mnt/data
Next take backup using tar or any other command of your own choice.
ddrescue command supports tons of options, read man page for more information:
# man ddrescue
OR
# man dd_rescue
This program is useful to rescue data in case of I/O errors, because it does not necessarily abort or truncate the output. This is why you need to use this program and not dd command.
- Email this to a friend
- Printable version
- Rss Feed
- Last Updated: Sep/27/2007

{ 17 comments… read them below or add one }
Fantastic post!!! a massive help. Thanks for saving my ass.
Very helpul thanks!
Thanks, excellent article.
I have a couple of doubts, though. I haven’t able to install it using apt-get command :( Any hint?
@htc,
Hmm…
Try to update apt database and again run same command:
apt-get update
apt-get install ddrescue
HTH.
Simple and effective :D good pice of work,IMPO
My personal experience is dd is slow and dd will never display any progress (which makes me more nervous about my data … LOL). I love ddrescue – one perfect tool for data recovery.
I have on hd with NTFS file system which has important data to backed up and I have one more computer which has Readhat linux installed on it. How I can use dd_rescue to retrive data out from that hd having NTFS file system.
Does anyone have a link to a
ddrescueman page that is something more than that the program itself puts on screen when the user enters parameters incorrectly? It would be nice to know more aboutddrescuethan just what the options list is!Use url for man page
HTH
Is there any other tool to recover files? I have a hard drive with bad sectors. It is an NTFS filesystem and has some importnat data on it. I have tried dd and now ddrescue, to no avail. I was trying to use autopsy/sleuthkit – but it requires an image. I am pulling my hair out trying to recover the files from this thing. I don’t care about the drive, just the data. All RAID from now on.
You guys might want to look at dd_rhelp also
http://www.kalysto.org/utilities/dd_rhelp/index.en.html
I haven’t used it but it seems to shorten the amount of time dd_rescue takes.
Udit,
Thanks for sharing link :)
The Linux tool called GNU ddrescue written by Antonio Diaz Diaz should not be confused with dd_rescue written by Kurt Garloff
They are two different utilities.
Actually, the command on Ubuntu should be
apt-get install gddrescue.
Not ddrescue. You have to have the g there.
On my Ubuntu 7.10, I can install the tool ddrescue
sudo apt-get install ddrescueAnd it got installed:
[sudo] password for vivek:Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
ddrescue
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.6kB of archives.
After unpacking 77.8kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com gutsy/universe ddrescue 1.13-3 [17.6kB]
Fetched 17.6kB in 2s (8220B/s)
Selecting previously deselected package ddrescue.
(Reading database ... 123654 files and directories currently installed.)
Unpacking ddrescue (from .../ddrescue_1.13-3_i386.deb) ...
Setting up ddrescue (1.13-3) ...
you write: “dd_rescue (also known as ddrescue)”. they are not at all the same software.
ddrescue and dd_rescue are completely different programs which share no development between them. the two projects are not related in any way except that they both attempt to enhance the standard dd tool and coincidentally chose similar names for their new programs.
ddrescue is the one to get.
actually gddrescue is the one you want, its updated more frequently and incorporates the functions of the original dd_rescue and dd_rhelp.