I have a damaged external usb hdd. When i connect the device to the pc i can access the file system for round about a minute. After that period the disk keeps spinning but every io operation times out.
To rescue my data i want to use ddrescue
but since the device stops working every minute, this won't recover much, when i don't reset the usb device each time a read timeout occurs, since the most probable reason for that is, that the device hang up again. Is there a way to let ddrescue execute a shell command or so, whenever a read timeout occurs?
It is not possible to connect the external hdd via sata, since there isn't a accessible sata connector inside.
Best Answer
I know nobody's gonna read this, so I won't elaborate it too much. And it's a pity because this is the only method that works.
PROBLEM: Trying to rescue lots of valuable photos from a HDD with lots of bad sectors. When the reading software stumbles on a bad sector, it hangs (becomes unresponsive) and the only thing you can do is to unplug the USB.
THINGS TRIED: (didn't work)
All software promise that they "skip bad sectors without stop". False.
Besides, these tools don't allow to select a block o resume.
Not tried: DeepSpar Disk Imager (hardware, costs $3.000+).
APPROACHING THE SOLUTION
ddrescue is a complex program where everything is configurable. It runs on Linux and on Windows (with Cygwin). Tutorial. I wasn't able to run DDRescue-GUI (some XOpenDisplay error), besides the GUI simpler than the command-line.
Things tried with ddrescue. Some people suggested some workarounds:
SOLUTION
A host with a Virtual Machine (VirtualBox). The host runs a server that listens to attach/detach commands and sends them to the VM.
A Windows guest VM that runs a manager script that controls the workflow: start/stop ddrescue, send attach/detach commands to host, and move forward the position in the mapfile.
A Linux (Debian) VM didn't work. After detaching, VirtualBox says: "Failed to attach the USB device to the VM"
.
Obviously you will need to adapt the configuration to your system.