ddrescue

from Wikipedia, the free encyclopedia
GNU ddrescue (gddrescue)

Heckert GNU white.svg
Ddrescue 2.png

Screen output from ddrescue
Basic data

developer Antonio Diaz Diaz / GNU Project
Publishing year August 12, 2004
Current  version 1.25
(February 21, 2020)
operating system Unixoid systems
programming language C ++
category Data recovery
License GPL ( Free Software )
German speaking No
www.gnu.org/software/ddrescue/ddrescue.html

GNU ddrescue (from English to rescue ) is a command line program for data recovery. The program copies data from a file or from a block-oriented device ( hard disk , CD-ROM or the like) to another file or to another block-oriented device. If there are read errors, it tries to reproduce the data as much as possible; Areas with reading errors are initially generously skipped over and put back in order to feel as close as possible to areas that can no longer be read later. In view of the remaining service life of the data carrier (which is limited in the event of a possible complete failure), it is possible to first copy large amounts of data that can be read without problems, before repeating time-consuming attempts to read defective areas.

History and reason for development

Antonio Diaz Diaz began developing ddrescue in the summer of 2004 to rescue data from a faulty CD-ROM after he could not find a program that met his needs for the task.

Diaz was and is the sole developer and programmer of ddrescue and describes it as a somewhat complex, but small project, for which therefore no more than one developer is required.

Differentiation from other programs

ddrescue differs from dd in that it has a sophisticated algorithm that copies data from intermittent drives in a way that causes as little further damage as possible.

GNU ddrescue is not the same as dd_rescueKurt Garloff's older utility .

Names of the programs and their program packages
program package developer annotation
Debian et al. Ä. Fedora, CentOS, etc. Ä.
ddrescue gddrescue ddrescue Antonio Diaz Diaz Is described in this text.
dd_rescue - dd_rescue Kurt Garloff  

There is a shell script called dd_rhelpGarloffs that calls dd_rescueseveral times to do something similar to GNU ddrescue; however, the collaboration between dd_rescueand dd_rhelpaccording to Antonio Diáz Diáz and others is said to be comparatively inefficient.

Task of the program

A short log file from ddrescue; if more errors occurred, such a file can be much longer.

According to its program author, ddrescue can mainly be used for two tasks:

  1. restoring data from a defective hard drive to another hard drive
  2. the deletion of all good sectors of a hard disk while retaining the defective ones in order to be able to send the hard disk to the manufacturer for complaint without unnecessarily disclosing your own data.

GNU ddrescue has the most sophisticated algorithm for changing block sizes that there is in open source software . It is considered a major data recovery tool and is used professionally.

If you use the mapfile option of ddrescue, the data is copied particularly efficiently because only the required blocks are read. In addition, you can interrupt the data recovery at any time and continue it later at the same point.

Special uses

Automatic combination of saved data : If you already have several damaged images of a file, CD-ROM or other block-oriented storage, ddrescue can use these to compile an image with minimal error blocks; ideally even a faultless one. Otherwise, ddrescue will only read the blocks that are still required during the second and each subsequent copy process, using the log file (map file) to be specified as a parameter.

The author of ddrescue recommends compressing backups with lzip because the Lzip format is designed for long-term archiving of data and offers data recovery functions that complement the capabilities of ddrescue. If the loss of data in a file is due to a damaged disk, a collaboration between ddrescue and Lziprecover is the best way to recover data from multiple damaged copies.

ddrescue can overwrite selected parts of the output file (fill mode). This can be used, for example, to delete data or to mark defective sectors and, in some cases, to make damaged sectors usable again.

Application examples

The easiest and usually best way to use ddrescue is ddrescue source target mapfile without any special parameters. Instead of using dd , this makes sense if you even have the slightest suspicion that the device from which you want to pull the image could produce read errors. Example: Assuming an old floppy disk to be backed up is in the / dev / sdg drive, you start

ddrescue /dev/sdg  myfloppy.img  myfloppyddrescue_map

Make sure that the drive is not mounted or is only mounted for reading. After starting, ddrescue continuously shows which areas it is currently reading or trying to read. If the reading process is error-free immediately or after a few attempts, you will receive an error-free image as quickly as possible. myfloppyddrescue_map contains a simple, readable list of areas with and without errors. Ideally, this is only an area of ​​the total disk capacity that is marked as error-free.

The file created in this way can be mounted as a loop device under Unix-like operating systems .

mount -o loop,ro myfloppy.img /mnt

Recover a hard drive

Example: ddrescue a hard drive with two Ext2 - partitions of / dev / sda to / dev / sdb to restore. We use the non-existent device files sdXa and sdXb in all of the commands below as placeholders for the actual device files (e.g. sda , sdb ) in order to prevent accidental data loss if you overlook to replace individual placeholders when copying and pasting.

Hardware constellation

The example assumes - even if other constellations are possible - that four data carriers are connected to the computer:

Oxygen480-devices-drive-harddisk.svgthe hard drive to be restored or copied ( /dev/sdXa),
Oxygen480-devices-drive-harddisk.svgan empty second hard drive ( /dev/sdXb) at least as big as the first one to be copied,
Oxygen480-devices-drive-optical.svga CD-ROM drive for a Linux Live CD and
Oxygen480-devices-drive-removable-media-usb-pendrive.svga USB stick for the map file from ddrescue ( /dev/sdc1).

The use of a separate USB stick for the map file ensures that the file is retained even in the event of a system crash. On the other hand, if you only save it in the file system of the live CD (which is only available in the main memory ), it will be lost when the system is restarted, which means that ddrescue cannot continue its work from the point at which it was interrupted. Since a restore run by ddrescue can take several hours, this is a risk that should not be neglected.

ddrescue during the program run

The command sequence

The computer is started via a Linux Live CD such as Parsix, Kanotix , then the following commands are entered one after the other on the command line:

ddrescue -f -n /dev/sdXa /dev/sdXb /media/myusb/rescue.map
ddrescue -d -f -r3 /dev/sdXa /dev/sdXb /media/myusb/rescue.map
fdisk /dev/sdXb
e2fsck -v -f -p /dev/sdXb1
e2fsck -v -f -p /dev/sdXb2

The commands in detail

step command function
1 ddrescue -f -n /dev/sdXa /dev/sdXb /media/myusb/rescue.map The first run of ddrescue, in which only those data are copied that ddrescue can easily read.
-n ("no-split"), do not divide faulty areas or try to read them several times.
2 ddrescue -d -f -r3 /dev/sdXa /dev/sdXb /media/myusb/rescue.map Second run of ddrescue, in which it -r3tries to read every sector that is not easy to read up to three times (parameter " "). The output of the first run is supplemented by this second run, i.e. ddrescue tries in this second run to fill the gaps in the output of its first run.
3 fdisk /dev/sdXb If the partition table is damaged, you have to try in this step to restore the partition table with fdisk.
4th e2fsck -v -f -p /dev/sdXb1 Detects and corrects possible errors in the file system of the partition sdb1 written by ddrescue .
-f (English "force"), under all circumstances forced checking of the file system.
-p (English "preen") automatic correction of all problems that do not require human intervention.
5 e2fsck -v -f -p /dev/sdXb2 Detects and corrects possible errors in the file system of the partition sdb2 written by ddrescue.

distribution

ddrescue is a preinstalled component of various GNU / Linux distributions and is also available for FreeBSD .

Some live systems that come with ddrescue as standard:

See also

Individual evidence

  1. a b gddrescue. In: "Ubuntuusers.de". December 28, 2013, accessed on December 28, 2013 : "Warning, risk of confusion: In addition to the gddrescue package, which contains the ddrescue program, there is also the ddrescue package with the dd_rescue program."
  2. a b c Interview With GNU DDRescue's Antonio Diaz Diaz. (No longer available online.) In: "Blue-GNU - News for Gnus". August 15, 2007, archived from the original on April 15, 2008 ; accessed on December 28, 2013 .
  3. GNU ddrescue Manual. The GNU project, accessed September 6, 2013 .
  4. Disk drive recovery: ddrescue, dd_rescue, dd_rhelp. (No longer available online.) John Gilmore, archived from the original on May 30, 2013 ; Retrieved September 6, 2013 . Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / www.toad.com
  5. Damaged Hard Disk. Www.cgsecurity.org, accessed on September 6, 2013 .
  6. Best Data Recovery Tools - Top 10 List. Geekyprojects, accessed September 6, 2013 .
  7. 12 essential system recovery tools. PC Plus Issue 303 22nd Jan 2011, accessed September 6, 2013 .
  8. gnu ddrescue to the rescue! Jelsoft Enterprises Ltd., accessed September 6, 2013 .
  9. Ddrescue - Data recovery tool. The GNU project, accessed September 6, 2013 .
  10. GNU ddrescue Manual: “7 A small tutorial with examples”
  11. ^ J. Harris: ddrescue 1.17. Port details. In: "FreshPorts.org - New ports and applications [for FreeBSD]". August 16, 2007, accessed January 12, 2014 .
  12. Package lists for grml32-small 2013.09 [-rc1]. In: "Grml.org". October 17, 2013, accessed January 13, 2014 .
  13. Complete software list (CD, approx. 1000 programs). In: "Knopper.net". June 26, 2013, accessed January 13, 2014 .
  14. Programs Included in Parted Magic 2014_01_04 - Parted Magic LLC. (No longer available online.) In: "PartedMagic.com". January 10, 2014, archived from the original on January 13, 2014 ; accessed on January 13, 2014 . Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / partedmagic.com
  15. Detailed-packages-list [SystemRescueCd-3.8.1]. In: "Sysresccd.org". October 28, 2013, accessed January 13, 2014 .
  16. Version 12.04. (No longer available online.) In: "Ubuntu-rescue-remix.org". April 26, 2012, archived from the original on January 28, 2014 ; Retrieved January 18, 2014 : "Ubuntu-Rescue-Remix features a full command-line environment with the newest versions of the most powerful free / libre open-source data recovery software including GNU ddrescue, Photorec, The Sleuth Kit, Gnu-fdisk and Clamav. “ Info: The archive link was automatically inserted and not yet checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / ubuntu-rescue-remix.org

Web links