Forrest logo
back to the ddrescue tool

ddrescue:tldr:d9ddf

ddrescue: Clone Disk A to Disk B, creating a log file.
$ sudo ddrescue --force --no-scrape ${-dev-sdX} ${-dev-sdY} ${path-to-log-txt}
try on your machine

This command uses the ddrescue utility with certain options to perform data recovery from one storage device to another. Here's what each part of the command means:

  • sudo: This command runs the subsequent command with administrative privileges. It may prompt for the user's password.

  • ddrescue: It is the name of the utility used for data recovery.

  • --force: This option tells ddrescue to overwrite the output device (/dev/sdY) even if it contains data. Use with caution as existing data will be lost.

  • --no-scrape: This option makes ddrescue skip reading data from the source device (/dev/sdX) when errors occur. It helps to speed up the recovery process.

  • ${-dev-sdX}: It represents the path to the source device from which data will be recovered. Replace ${-dev-sdX} with the appropriate source device path such as /dev/sda or /dev/sdb.

  • ${-dev-sdY}: It represents the path to the destination device where recovered data will be written. Replace ${-dev-sdY} with the appropriate destination device path.

  • ${path-to-log-txt}: It represents the path where the log file containing recovery status will be stored. Replace ${path-to-log-txt} with the desired location and filename of the log file. For example, /path/to/log.txt.

By executing this command, ddrescue will start recovering data from the source device to the destination device, and it will create a log file to keep track of the recovery progress.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ddrescue tool