📜 ⬆️ ⬇️

Saving data to windows using ddrescue

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


One day, after a power failure, the old Windows file server was partially out of order and stopped turning on. Nobody began to search for analogs of the ancient hardware, so the only thing needed was to create an image of the encrypted partition located on the hardware raid5. Unfortunately, there was no other motherboard with a pci-x bus where the raid controller could be inserted, so it was necessary to do this on the old server. After the diagnostics and replacement of the failed parts, the server started, but went into reboot about once every 5 minutes. It was decided to use ddrescue. The driver for SLES11 was found on the raid manufacturer’s website; unfortunately, there was no correct instruction for it and it didn’t work. Then I thought about building ddrescue for windows, for which I had a raid driver, easier than getting the raid controller driver to work under linux. I started by installing cygwin. The official site is a web installer that downloads the files you need from the specified mirror. 5 minutes before the reboot, the installer did not have time to download everything that was needed, so I had to download it on another PC, then feed the distribution kit to the installer. The biggest surprise was waiting for me at the stage of choosing additional software installed with cygwin - there was a compiled ddrescue package! Therefore, most did not have to collect.

After installation, you need to find out how cygwin numbers the disks so as not to overwrite what you need. All devices are named / dev / sd *, where the last character corresponds to the disk number in windows “disk management” (disk 0 - sda, disk 1 - sdb, etc.). fdisk / cfdisk with cygwin is not supplied and is not in precompiled packages, so in order to make sure that the correct disk is listed under the name you are supposed to, you can take the following steps:

Next - 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 in autoload. Now the cloning is not terrible to reboot, after a few hours a copy is ready.
All operations were performed 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.

')

Source: https://habr.com/ru/post/213337/


All Articles