Projects / GNU ddrescue

GNU ddrescue

GNU ddrescue is a data recovery tool. It copies data from one file or block device (hard disk, CD-ROM, etc.) to another, trying to rescue the good parts first in case of read errors. GNU ddrescuelog is a tool that manipulates ddrescue logfiles, shows logfile contents, converts logfiles to/from other formats, compares logfiles, tests rescue status, and can delete a logfile if the rescue is done.

Tags
Licenses
Operating Systems
Implementation

Recent releases

  •  12 Jun 2014 11:37

    Release Notes: A bug has been fixed in the "or" and "xor" operations of ddrescuelog. New "-H, --test-mode", "-L, --loose-domain", "-N, --no-trim", "-O, --reopen-on-error", "-1, --log-rates", and "-2, --log-reads" options have been added. The "-K, --skip-size" option has been extended. If ddrescue is interrupted by a signal, it now terminates by raising that signal. The algorithm of the copying phase has been changed. The "-B, --binary-prefixes", "-C, --complete-logfile", and "-P, --compare-as-domain" options have been added to ddrescuelog. Many improvements have been made to the documentation.

    •  26 May 2014 17:28

      Release Notes: ddrescue now warns that sizes shown are limited to the domain when the domain is smaller than the logfile. "ddrescuelog -t" now shows logfile and domain extents when the domain is smaller than the logfile. This is the final release candidate before 1.18 stable.

      •  06 May 2014 15:47

        Release Notes: The option "-K, --skip-size" has been extended to accept a maximum skip size and to disable skipping. Speed has been improved when using complex domains with the option '-m, --domain-logfile'. Speed of logic operations in ddrescuelog has been improved. Timestamps have been added to rescue, rates, and reads logfiles. A status message describing the operation being performed and the current direction has been added to the rescue logfile. A single tab character is now used as field separator in the reads logfile to reduce its size.

        •  31 Mar 2014 16:07

          Release Notes: Fixes a bug (introduced in 1.18-pre8) that sometimes marked a bad sector as finished when reading backwards. The option "-H, --test-mode" has been added. The default value of the option "-l, --logfile-size" has been increased to 10000. The copying phase is limited to 3 passes. The pass number and direction are shown during the copying phase. A bug has been fixed in the "or" and "xor" operations of ddrescuelog. The option "-P, --compare-as-domain" has been added to ddrescuelog.

          •  10 Mar 2014 12:13

            Release Notes: If ddrescue is interrupted by a signal, it now terminates by raising the signal received. The algorithm of the copying phase has been changed. It now marks as non-trimmed just the failed blocks, skips beyond them, and tries the skipped areas later in additional passes (before trimming), reversing the direction after each pass. The new method produces better starting points for trimming, which now tries the smallest blocks first. The message "About to copy an unknown number of bytes" is now shown when the size of the input file can't be determined.

            Recent comments

            29 Aug 2012 02:44 dufobik

            I too have problems with drives stopping responding. ddrescue doesn't notice that the drive is not communicating at all, and proceeds to log the rest of it as errors.

            There is a SATA disk reset command, it's a variation on:
            echo "- - -" > /sys/class/scsi_host/host*/scan
            For me, it makes the drive responsive again.

            It would be fantastic if ddrescue could detect if a drive has dropped off, and issue the appropriate command to get it back online.

            26 Nov 2010 02:02 Romster

            I highly recommend this project. I would love to see a option to recover only used FS blocks or failing that to make ddrescue use a library for it's core functionality and then get http://freshmeat.net/projects/fsarchiver to use ddrescue library to attractive this. One other comment some disks seem to stop all data transfer and the only way to resume is to reboot the machine and continue from the ddrescue log file, there has to be some disk ata reset command or some electronics one could do to be able to power down/up the hard disk. I can do the electronics side of it.

            17 Jul 2009 07:38 CorvusVCorax

            Hi guys,
            I'm the developer of safecopy ( http://freshmeat.net/projects/safecopy ) (which basically is another dd_rescue clone around for a couple of years). Aside from advertising my project on the comment page of the biggest competitor here *sic* I would encourage you guys to have a look on a little debug library (wrapper for glibc) I wrote and packaged with safecopy, which simulates IO-errors on a virtual file.
            Unless you already use something like that internally for debugging and testing of ddrescue it might help your development work for benchmarks or creation of a test suite.

            20 Sep 2005 13:40 rtpdave

            Using ddrescue and SpinRite together
            I've created a "Quick and Dirty" Perl program which reads a GNU ddrescue 1.0 "logfile" (sector list file), and generates a DOS .bat file of SpinRite 6.0 commands to try to recover the unrecovered regions. After SpinRite has completed its work, you can run ddrescue 1.0 again to add the recovered data to the recovery image. You can get my little Perl program here:
            http://www.burtonsys.com/download/ddr2sr.zip (http://www.burtonsys.com/download/ddr2sr.zip)


            Note #1: This little Perl program can be run under any system that supports Perl 4 or 5 (Linux, DOS, Windows, etc.).
            For tiny compatible Perl 4 implementations for DOS and Windows, see:
            http://www.burtonsys.com/auxil/#tinyperls (http://www.burtonsys.com/auxil/#tinyperls)


            Note #2: ddrescue runs under Linux, and SpinRite runs under MS-DOS or FreeDOS. So (obviously) some rebooting will be required.


            Note #3: You must use Antonio Diaz's GNU ddrescue 1.0:
            http://freshmeat.net/projects/addrescue/ (http://freshmeat.net/projects/addrescue/)
            You cannot use ddrescue 0.9 or earlier, nor can you use Garloff's dd_rescue (which is an entirely different program).


            Note #4: Gibson Spinrite will set you back U.S. $89. I think it is well worth it (and I have no connection to Gibson, other than as a satisfied SpinRite user). Get it here:
            http://www.grc.com/sr/spinrite.htm (http://www.grc.com/sr/spinrite.htm)


            -Dave

            16 May 2005 18:32 rtpdave

            Fast, effective, and flexible!
            I compared the speed of Antonio's ddrescue 0.9 to the speed of dd_rescue for copying error-free data on a PC with ATA/EIDE drives, and Antonio's ddrescue ran nearly twice as fast as dd_rescue.

            Since dying hard disk drives tend to get sicker and sicker as time goes on, I think speed it is important, to improve the success rate of the rescue. ddrescue's better speed could also help with "freezer-based" hard disk drive recovery. Sometimes a dying hard disk drive can be coaxed into working again, briefly, by sealing it in a plastic bag and freezing it in the freezer overnight. (I'm now 1-for-3 recovering hard disk drives with this technique.) But, of course, when you take it out of the freezer and plug it into your computer it starts warming up. You may only have a few minutes to recover your data before the drive warms up and starts failing again. So a faster ddrescue improves your chances of getting all the data off before the drive gets too warm.

            The new 1.0pre1 is a gigantic improvement over 0.9! I've not benchmarked it, but I assume that the speed is about the same. However, the new logfile format has many advantages!

            The most important advantage is that it enables you to do multiple ddrescue passes to recover your data. For example:

            # first, grab most of the error-free areas in a hurry:

            ddrescue -B -n /dev/hdd rescued.ima rescued.log

            # then try to recover as much of the dicy areas as possible:

            ddrescue -B -r 1 /dev/hdd rescued.ima rescued.log

            (the "-r 1" is necessary to make it retry the failed areas)

            Then put the drive in the freezer overnight (or run SpinRite on it), and then try again:

            ddrescue -B -r 1 /dev/hdd rescued.ima rescued.log

            (it won't recopy the already copied areas)

            You can also run it on just part of the disk, e.g., to try extra hard to recover the most important areas. This example retries extra hard (10x) to recover any bad areas in the first 50 MB of the drive:

            ddrescue -B -r 10 -s 52428800 rescued.ima rescued.log

            Each time you run it, ddrescue updates the logfile to show which areas of the disk drive or file were successfully copied, which failed to copy, and which are yet to be attempted. It also updates the logfile when you halt it with Ctrl-C, and also saves it every 30 seconds during normal operation (in case of a crash).

            When you are done, the logfile also serves as a nice, concise ASCII record of where the good and bad areas are in the copy of the drive or file. I can envision tools and scripts which use that information to identify the damaged files on a rescued disk drive, or which consolidate the good areas of the two copies of the FAT on a FAT16 or FAT32 drive, or which identify the damaged areas that are in "free space" and just mark them as "good" (because their contents don't matter), etc., etc..

            ddrescue 1.0pre1 is a wonderful little utility, and (thanks to the simple, well-documented ASCII logfile format) it is nicely extensible.

            Great job, Antonio!

            -Dave

            Screenshot

            Project Spotlight

            OpenStack4j

            A Fluent OpenStack client API for Java.

            Screenshot

            Project Spotlight

            TurnKey TWiki Appliance

            A TWiki appliance that is easy to use and lightweight.