ddrescue for Windows

Install ddrescue and recover data in Windows

Install ddrescue and recover data in Windows

Credit to phatboyj on stackoverflow for the script to list device paths in Cygwin.

  1. First, we have to install a package manager for linux programs called Cygwin. Download it from https://cygwin.com/setup-x86_64.exe

    Run the installer and follow the prompts–you can leave all options as their defaults. (You can specify a different folder on the Select Local Package Directory screen if you want to store the installer files somewhere else than your default Downloads folder.)

    • On this screen you can pick any mirror.

    Choose A Download Site

    When you come to the Select Packages screen, switch View to Full, type ddrescue in the Search field. To the right of ddrescue, under the New column, drop down the field that shows Skip and select 1.28-2 and click Next.

    Select ddrescue to be installed

    Click Next again to start the installation process and then click Finish once complete (you can uncheck the options to create icons if you want).

  2. Next we’ll need to determine the identifier for the disk to be rescued. Open Windows Explorer (🪟+E)and note the drive letter.

    Windows Explorer displaying drive labels and letters.

    Open a terminal by pressing 🪟+X and click on Terminal (Admin). Run the following command. (If you installed Cygwin to another location, this command will be the full path to Cygwin.bat)

    C:\cygwin64\Cygwin.bat
    

    In the Cygwin prompt, run the following script.

    for F in /dev/s* ; do echo "$F    $(cygpath -w $F)" ; done
    

    Make note of the /dev/s* path for the drive letter of the disk to be rescued. In this example, we are rescuing the optical D: drive and the device path is /dev/sr0

    Output of the script which shows Cygwin device paths.

    End the Cygwin session by running the command exit

  3. Now we’ll run ddrescue using the device path we noted previously.

    Run the following command. Specify the device path (/dev/s*) identified from the previous script and destination image file path (standard Windows path). It is also recomended to specify a logfile path in case the operation is interrupted (it can resume if the same command is run with the existing logfile specified). Take care to not save the image file to a path on the disk being imaged.

    c:\cygwin64\bin\ddrescue -d -r3 [/dev path] [output image path] [logfile path]
    

In this example, /dev/sr0/ is our input device path, and we are saving the output image to C:\rescue\test.img along with a logfile.

ddrescue doing its thing, but in Windows

With the saved image file, you may now use other tools to mount or extract files from the image. In this example, we imaged a CD-ROM disk and the image can be opened or extracted with 7-Zip or natively mounted in Windows.

Windows Explorer context menu options for the image file.

Built with Hugo
Theme Stack designed by Jimmy