What's the difference between ddrescue, gddrescue, and dd_rescue?

The dd command is commonly used to make image backups of a drive or partition. However, it performs poorly if the source drive is unreliable or failing. I read that ddrescue/dd_rescue is a good tool to use to recover an image from a bad drive, since it intelligently attempts to re-read sectors that it failed to read the first time.

But in the Ubuntu repositories, I see two different ddrescue programs, with 3 different but similar names showing up in different places: ddrescue, gddrescue, dd_rescue. What’s the difference?

Asked By: Mechanical snail


ddrescue, confusingly, can refer to two completely separate programs, dd_rescue by Kurt Garloff, and GNU ddrescue. Both have the same purpose and are actively developed.

Garloff’s program dd_rescue is the first attempt to improve on dd; GNU ddrescue is newer and was created to address shortcomings in dd_rescue.

Several sources prefer GNU ddrescue over dd_rescue. For example,

  • http://lwn.net/Articles/430000/

    ddrescue wins (in my book) because it is an efficient self-contained program written in C++ (not a shell script kludge), produces much cleaner output on the console/terminal, and (most importantly) handles unreadable blocks gracefully and intelligently.

  • http://www.toad.com/gnu/sysadmin/index.html#ddrescue

    GNU ddrescue is your best friend.

    It is modeled after the two preceding programs, dd_rescue (with an underbar), and dd_rhelp. But GNU ddrescue it’s far better than both — I’ve tried all three, on the same drive, as well as trying to use plain old “dd”.

    Antonio Diaz Diaz’s GNU ddrescue learned from these experiences. It combines both dd_rescue’s ability to read big blocks and then shift gears, with dd_rhelp’s ability to remember what parts of the disk have been looked at already. It keeps this info in a really simple logfile format, and keeps it updated every 30 seconds, or whenever it stops or is interrupted. It’s written in C++ and it’s small and fast.

One advantage of GNU ddrescue is that it backs up most data faster, by first skipping bad blocks (hich are slow to recover) and coming back to them only after good blocks have been backed up. One disadvantage of GNU ddrescue is that it doesn’t support piped output, which means you can’t compress the output image with gzip or lzop.

Ubuntu packages

Unfortunately, the package names in the Ubuntu repositories are confusing; dd_rescue is packaged under the name ddrescue, and ddrescue under gddrescue! From the package summaries:

  • gddrescue package:

    Please note that this is the GNU ddrescue version providing
    the /sbin/ddrescue executable. If you are searching for the
    ddrescue version of Kurt Garloff please check out the
    ddrescue package instead.

  • ddrescue package:

    Please note that this is the dd_rescue version of Kurt Garloff
    providing the /bin/dd_rescue executable. If you are searching
    for the GNU ddrescue version please check out the gddrescue
    package instead.

Summary of names:

Program name     Ubuntu package name     Executable name    Name in URL
GNU ddrescue     gddrescue               ddrescue           ddrescue
dd_rescue        ddrescue                dd_rescue          ddrescue
Answered By: Mechanical snail