dd_rescue vs GNU ddrescue: why do you need a clone when there is an original

    In the article Copying hard disk partitions using GNU / Linux: how to get around a bootable USB flash drive where Acronis used to be , I advised using GNU ddrescue to copy potentially damaged disks, rather than the original, which I called obsolete. But in the comments, nerfur indicated to me that dd_rescue is regularly updated and knows how to compress data on the fly for subsequent transmission via ssh. Since the GNU ddrescue is not up to the task, rumors of obsolescence of dd_rescue are apparently greatly exaggerated.

    It’s clear - you need to immediately find out how the modern version of dd_rescue differs from GNU ddrescue, which can and, perhaps, remove the recommendation to avoid using the original from the article. And also write a new article - about the differences between these two programs, which I did.

    For those who want to quickly find out how the matter ended and are not interested in the heartbreaking details, I’ll say right away that after studying the issue my opinion has not changed - I still recommend using GNU ddrescue, but now for another, much more sane reason - GNU ddrescue first saves well readable areas of the disc and only then proceeds to the rest. dd_rescue cannot do this by design.

    Historical reference


    Traditionally, to create binary copies of physical drives in * nix systems, the dd program was used, which read a disk with pieces of a predetermined size. She coped well with the task when it came to copying data from healthy devices, but for handling partially damaged dd disks, she earned the nickname disk destroyer.


    To take data from a damaged surface, Kurt Garloff wrote a utility that worked roughly like dd, but when meeting with bad sectors, it did not read the disk to death and did not ignore errors, but by reducing the speed to the minimum possible, it saved everything that could be saved.

    Despite the obvious progress compared to dd, dd_rescue read the entire file in one pass, moving in measured steps from the beginning to the end. Due to the presence of an unreadable area, the process of obtaining an exact copy could take hours, months or even years, while the time to obtain a copy that was 99 percent reliable was measured in tens of minutes.

    In addition, during a slow and thoughtful reading of incense-breathing sectors, everyone else (normally read at the time the program was launched) could well drop their hooves because their time had come. If they had been read a minute or two earlier - everything would have been fine, and so - a moment has been missed - this happens.

    The best option would be to first save everything that is being read without problems, and then start reading unreliable fragments, but dd_rescue did not know how to do this, although it had all the necessary arsenal of capabilities. Therefore, the implementation of the above could only be done manually.


    As you know, if the mountain does not go to Mohammed, then Mohammed may well approach it independently. I think somehow LAB Valentin reasoned when he decided to write a bash script that uses dd_rescue to implement the optimal strategy for copying damaged files.

    In the end, the author of dd_rescue included this script, dd_rhelp, in the official version of the main program.

    GNU ddrescue

    dd_rhelp in conjunction with dd_rescue greatly simplified the process, but it had one fatal flaw - it was not written in Cworked terribly slowly.

    Unable to put up with this, Antonio Diaz decided to flush his program with an algorithm and constants, which he called - surprise - GNU ddrescue.

    This is how dd_rhelp reacted to this.
    For a while, dd_rhelp was the only tool that could do this kind of work, but for several years now it’s not like this: Antonio Diaz wrote the perfect replacement for my tool: GNU 'ddrescue'.

    Yes, calling the tool by the same name as Kurt Garloff’s dd_rescue wasn’t very clever (do you catch the subtle difference between GNU ddrescue and dd_rescue?), But it seems that this was done as we warned Antonio Diaz, that this is sure to bring confusion to the miniature world of hard drive recovery tools.

    Nevertheless, if this tool solves your problems (and it should be so), I urge you to use it. Why? First you need to figure out what we are comparing:
    - dd_rhelp (dirty bash script) + dd_rescue (C) on one side
    - GNU ddrescue (C) with another / * actually GNU ddrescue is written in C ++ * /

    dd_rhelp was conceived as a quick hack to implement what dd_rescue did not do and which at that time could not be done at all.

    Perhaps there are cases in which GNU ddrescue does not work and this is the main reason I continue to support dd_rhelp. It is very important to report such cases to me and Antonio Diaz.

    For some times, dd_rhelp was the only tool (AFAIK) that did this type of job, but since a few years, it is not true anymore: Antonio Diaz did write a ideal replacement for my tool: GNU 'ddrescue'.

    Yes, this is not very clever to have called a tool the same name that 'dd_rescue' from Kurt Garloff (catch the subtle difference between 'GNU ddrescue' and 'dd_rescue'?), But it seems that it was done by intent as we warned Antonio Diaz from the fact it would probably mess users in this tiny world of hard drive recovery tools.

    Nevertheless, I really encourage you to use this replacement tool if it works for you (and it should be the case). Why? Understand first what we are comparing:

    dd_rhelp was meant as a quick hack to implement what dd_rescue didn't do, and what couldn't be done at that time (AFAIK).

    It could be some cases where GNU ddrescue won't work, and this is the major reason why I keep maintaining dd_rhelp. It is important to tell me and Antonio Diaz when these cases occur.


    As already mentioned, dd_rescue and GNU ddrescue are still periodically updated, but dd_rhelp is frozen at the 2008 level, and it seems like forever. The 2012 update, however, made some cosmetic changes, but this has not changed much.

    How to be a simple user

    Use GNU ddrescue to create copies of obviously problematic disks

    Where dd_rhelp functionality is needed, it is better to use GNU ddrescue. As shown above, dd_rescue can replace GNU ddrescue only in conjunction with dd_rhelp, whose author recommends not using his brainchild if possible.

    Use dd_rescue when you need an improved version of dd

    On the other hand, if dd_rhelp functionality is redundant for you, then dd_rescue has a couple of tricks up its sleeve that GNU ddrescue does not own. First of all, dd_rescue can redirect the output to the pipe, which is simply irreplaceable, for example, when copying via ssh. In addition, there is a plug-in mechanism with the help of which compression and decompression are supported on the fly, as well as various hash calculation algorithms. dd_rescue is well suited where you need a simple dd substitute with advanced functionality and insurance in case of errors that can be corrected by re-reading. And the documentation says that it draws a progress bar :).

    To create a backup copy of the disk - other things being equal, use GNU ddrescue

    In my opinion, when it comes to removing a disk image, and saving it to another disk directly connected to the same computer, there is no reason to abandon GNU ddrescue in favor of dd_rescue or dd, but using the optimal data copying strategy that they have not implemented, it can be good insurance and save the user from many unexpected troubles.

    Also popular now: