Hi Antonio,
Thank you Peter, Paul and Scott.
I'll include a paragraph in the manual about how to distinguish the
source and destination disks with the information you have provided.
I wonder how ddrescue could verify the source and destination disks
automatically in a reliable and device-independent manner.
The only way to reliably check that you have the source and target disk
right is to check their serial number (especially if you are cloning
to/from two hard disks with the exact same model number).
This is the reason why I always write these down on a piece of paper,
and double check with smartctl which is which.
One thing you may want to do is as follows: now we need to provide
--force in order to allow writing to a device and not a file. In such
cases, you may query the model number and serial number like smartctl
does, and print them to the console, and ask for a last confirmation
from the user ("Please check the model and serial numbers on the hard
disks, and press Y if they are correct").
I'm not sure how can you do that in a device-independent manner though.
You can find some C code to start with here:
http://stackoverflow.com/questions/2432759/usb-drive-serial-number-under-linux-c
Another thing I commonly do is that I zerofill the target disk before
using it as a target (which is a good thing to do anyway). That way, if
I open the disk in a hex editor, I can clearly see which drive is the
"empty" one, and which is the one that has some data. This is something
ddrescue could check automatically (say, is the first sector of the
target disk is all 0), and proceed if it really is. This requires some
getting used to from the user...
Hope this helps,
Peter
Best regards,
Antonio.
_______________________________________________
Bug-ddrescue mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-ddrescue
_______________________________________________
Bug-ddrescue mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-ddrescue