ddrescue

What do you have and what do you want?

Moderators: b1o, jkerr82508

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

ddrescue

Postby viking60 » 15 Jan 2013, 12:58

ddrescue is a simple way of rescuing your data on that broken disk (hard disc, cdrom, etc). It is a part of our berserk LiveCD so you can use that if your main system is going down the drain.
So what we do is simply to connect a disk (USB or other) that can hold our data and ddrescue our current disk over to the new one.

If you use the log function (ddrescue manipulates the log files) you can stop and resume the rescue and the likelyhood of getting an error free disk is high. Because the bad sectors will not be overwritten with zeros so the log will automatically see to that your system is autofixed.

ddrecue will only copy the files it needs so If you rescue the same file from three different places you will probably end up with one perfect file since ddrescue only will copy the lacking part (it is not very likely that the same sector is bad on all three files).

It will be present on the repos of most distros.

Here is a video:
:A


ddrescue will work regardless of the OS so you can use the Live CD to rescue Windows too.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: ddrescue

Postby rolf » 15 Jan 2013, 16:13

The installation of Mandriva 2011 on an ancient hand-me-down PATA hdd being used by GF and her nephew stopped doing stuff for them. When I got to it, the reiserfsck options did not repair the filesystem and halted on something like a bad sector report. In fact, dd would not work, either, because of bad sectors.

Looking at google, I saw ddrescue and tried that. Mandriva has two different flavors, dd_rescue and ddrescue :A

Code: Select all

[root@localhost rolf]# urpmq -i dd_rescue
Name        : dd_rescue
Version     : 1.20
Release     : 1mdv2011.0
Group       : System/Kernel and hardware
Size        : 35375                        Architecture: x86_64
Source RPM  : dd_rescue-1.20-1mdv2011.0.src.rpm
URL         : http://www.garloff.de/kurt/linux/ddrescue/
Summary     : Does copy data from one file or block device to another
Description :
Like dd, dd_rescue does copy data from one file or block device to another.
You can specify file positions (called seek and Skip in dd). There are several
differences:
  o dd_rescue does not provide character conversions.
  o The command syntax is different. Call dd_rescue -h.
  o dd_rescue does not abort on errors on the input file, unless you specify a
    maximum error number. Then dd_rescue will abort when this number is reached
  o dd_rescue does not truncate the output file, unless asked to.
  o You can tell dd_rescue to start from the end of a file and move bcakwards.
  o It uses two block sizes, a large (soft) block size and a small (hard) block
    size. In case of errors, the size falls back to the small one and is
    promoted again after a while without errors.

[root@localhost rolf]# urpmq -i ddrescue
Name        : ddrescue
Version     : 1.13
Release     : 1mdv2011.0
Group       : System/Kernel and hardware
Size        : 86289                        Architecture: x86_64
Source RPM  : ddrescue-1.13-1mdv2011.0.src.rpm
URL         : http://www.gnu.org/software/ddrescue/ddrescue.html
Summary     : Data recovery tool
Description :
GNU ddrescue is a data recovery tool. 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.

If you use the logfile feature of ddrescue, the data is rescued very
efficiently (only the needed blocks are read). Also you can interrupt the
rescue at any time and resume it later at the same point.

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. Using the logfile, only the needed blocks
are read from the second and successive copies.

The logfile is periodically saved to disc. So in case of a crash you can
resume the rescue with little recopying.

Also, the same logfile can be used for multiple commands that copy different
areas of the file, and for multiple recovery attempts over different subsets.

Ddrescue aligns its I/O buffer to the sector size so that it can be used to
read from raw devices. For efficiency reasons, also aligns it to the memory
page size if page size is a multiple of sector size.


I used the first of these programs on my SystemRescueCd. There are advanced options. I considered these, briefly, then went ahead with simple defaults, similar to the video. Long story, short, there were something like 45 bad sectors reported. I put the rescue output on a much newer SATA hdd hand-me-down and everything has been working fine. In this case, a lot easier and less time-consuming than throwing away the damaged data, re-installing. :B

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: ddrescue

Postby viking60 » 15 Jan 2013, 16:25

:s
It sounds like dd_rescue works like ddrescue from the description of it - I could not spot the difference...
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"


Return to “Software”