Compatible only with Linux, not with other *nix!
Depends on udev /dev and sysfs /sys kernel interfaces.
For SATA requires AHCI compatible motherboard. For all Intel and modern AMD platforms (AM4 and newer), check the UEFI Setup SATA settings to ensure Port Hot Plug is enabled.
For USB requires lsusb from usbutils package.
And optional uhubctl for power off/on cycle. Or hardware USB Relay Module LCUS-1 CH340
wget https://github.com/gumanzoy/ddrescue-loop/raw/main/ddrescue-loop
chmod +x ddrescue-loop
Please note the order of arguments. Keys must be passed in the same order as they are written.
Mixing not supported. Space between key and value is required.
Stop/start drive at SATA port:
ddrescue-loop -ata <n> -stopstop drive at SATA port<n>ddrescue-loop -ata <n> -scanscan SATA port<n>
Launch recovery from SATA drive:
ddrescue-loop -ata <n> [-loop <n>] [-pwc] [-wait <n>] [-act <n>] outfile mapfile [ddrescue options]
Specify the SATA port number to which the source drive is connected:
-ata <n> SATA port number <n> dight (look at dmesg output)
Stop/restart function for SATA drive in case of failure:
-loop <n> Limit number of attempts <n>
Timeout for drive get ready after stop/restart:
-wait <n> Time in seconds <n> [10]
Change ATA command timeout:
-act <n> Time in seconds <n> [30]
Power off/power on USB device VID:PID ID, by hub or rle method:
ddrescue-loop -usb <ID> -pwc hubUseuhubctl --search <ID>ddrescue-loop -usb <ID> -pwc rleUse USB Relay LCUS-1 CH340RLETTY=
Launch recovery from USB drive:
ddrescue-loop -usb <ID> [-loop <n>] [-pwc <hub/rle>] [-wait <n>] outfile mapfile [ddrescue options]
Specify the VID:PID ID of the source USB drive in Hex form:
-usb <ID> VID:PID separated by colon (look at lsusb output)
Restart ddrescue process (power off/on device) in case of failure:
-loop <n> Limit number of attempts <n>
outfileoutput device / outfilemapfileddrescue map/log file (required)
Use man ddrescue to read full list of options. Some important options:
-P [<n>]show some lines of the latest data read [3]-b 4096Sector size of input device<bytes>[default 512]-c <n>Sectors to copy at a time<n>[default 128]-OImportant! reopen input device file after every read error.-JOptional reread latest good sector after every error.-r <n>OR-r -1retry passes before trim (-1=infinity) [0]-m <domain.mapfile>restrict domain to finished blocks in<file>ddru_ntfsbitmap
Копирование информации с повреждённых носителей с помощью ddrescue
forum.ixbt.com
Костыли для ddrescue. Что делать если SSD перестает отдавать данные
habr.com/ru/articles/777230/
Восстановление данных с M.2 NVMe SSD. Скрипт ddrescue-loop v0.2
habr.com/ru/articles/785040/