Saving data in windows using ddrescue

    Many have heard of the * nix utility GNU ddrescue, designed to save data that is read with errors (there are two utilities with the same name, but I am considering the GNU version). On the hub there was a topic about it, telling the main features of this utility - copying data with writing to the log with subsequent attempts to count problem areas. But few people know that it can be used in the windows family of OS, under the cut, I will tell you how.


    Once, after a power failure, the old file server running windows partially failed and stopped turning on. Nobody looked for analogues to the ancient hardware, so the only thing that was needed from him was to make an image of the encrypted partition located on the hardware raid5. Unfortunately, there was no other motherboard with a pci-x bus where a raid controller could be inserted, so this had to be done on the old server. After diagnosing and replacing failed parts, the server started, but went into reboot about once every 5 minutes. It was decided to use ddrescue. A driver for SLES11 was found on the raid manufacturer's website, unfortunately, there was no correct instruction for it and it did not work. Then I thought that building ddrescue for windows, for which I had a raid driver, is easier how to make the raid controller driver work under linux. I started with the installationcygwin. On the official website is a web installer that downloads the necessary files from the specified mirror. 5 minutes before reboot, the installer did not have time to download everything that was needed, so I had to download it to another PC, then feed the installer to the distribution kit. The biggest surprise was waiting for me at the stage of choosing additional software installed with cygwin - there was a compiled package ddrescue! Therefore, I did not have to collect anything myself.

    After installation, you need to find out how cygwin numbers the disks in order not to overwrite what is needed. All devices are named / dev / sd *, where the last character corresponds to the disk number in the "disk management" windows (disk 0 - sda, disk 1 - sdb, etc.). fdisk / cfdisk is not supplied with cygwin and is not included in precompiled packages, therefore, in order to make sure that the necessary disk appears under the name under which it is assumed, the following steps can be taken:
    • viewing partition or disk data with the less -f command (for example, you can see the NTFS signature)
    • viewing partition size with cat / proc / partitions
    • viewing the number of partitions on a hard command ls / dev / sd *

    Next is a matter of technology. A single-line bat file was written with the following contents
    c: \ cygwin \ bin \ ddrescue.exe -f -D -v / dev / sdb / dev / sdc log.txt
    and put into autoload. Now the reboots are not afraid of cloning, after a few hours the copy is ready.
    All operations were carried out in the old OS, in windows vista and newer, it may be necessary to disable UAC / run the batch file from the administrator to access the disks.

    Also popular now: