GNU ddrescue - can someone give me a good command to run in terminal?
Solution 1:
You should check what disk is mounted where.. in the linux I used, and perhaps all linuxes, it's $mount . Recently used ubuntu and sudo parted -ls
worked really well for showing partitions along with the make and model and capacity of a drive and the size of each partition. You'd mount a partition of the target drive (the drive you will be writing the image to). Say it's sdb1, sudo mkdir /mnt/whatever
and mount /dev/sdb1 /mnt/whatever
. The mount command can autodetect the partition format/file system e.g. ntfs or whatever it is.
(i've used cygwin which doesn't use the moutn command, it's different and a little more complex to find that info in cygwin though you're not using cygwin)
You'll want to know what device /dev/sda is what device /dev/sdb is e.t.c.
You shouldn't really have your file system like /mnt/whatever pointing to it(the drive you are getting the image from). Just like in windows you shouldn't really have a drive letter assigned to the drive. There's this idea that if it is then something could easily write to it when you don't want it to.
i'm really not an expert on this at all but I have managed it from cygwin, and ubuntu
The basic command would look like this in cygwin
$ ddrescue -b 1M /dev/sdb /cygdrive/c/crp/asdf.a
or this in ubuntu
$ ddrescue -b 1M /dev/sdb /mnt/blah/asdf.a
essentially the same, just make sure you have the said 'to' directory so you can write the file there.
The command I used in cygwin (and I should probably have eliminated the -r3 at least the first time), was ddrescue -r3 -b 1M /dev/sdb /cygdrive/c/crp/fsfwr_.fc b.log
You can add a log file as I have there. But I have found the output is quite brief anyway from ddrescue. Some add --force / -f, i.e. $ ddrescue -r3 -b 1M --force /cygdrive/c/crp/debian-live-7.6.0-i386-gnome-desktop.iso /dev/sdb
But that -f/--force just seems to mean overwrite the 'to' file if it already exists. So it's not really important 'cos you can delete the 'to' file yourself if you wanted to eg do ddrescue again.
I slightly doubt it will take hours or hours longer, with retries set to 3..
I've read that -r means retries and the default is 0, and best to eliminate the -r the first time. So, would be even faster..
some advice regarding -r, e.g. the commonly used -r3
https://www.technibble.com/guide-using-ddrescue-recover-data/
-r3 tells ddrescue to retry bad sectors 3 times before giving up. Note: On a failing drive you may want to eliminate this option the first time so as to not waste time hammering on bad sectors and risking drive failure. You can always use the logfile to go back and retry the bad sectors after you get an image from the first sweep.
I've used -b 1M, this might be quite important, because the default is 512, and that would or could take ages. dd had the same issue.. It's possible that you could do 4M maybe and 4M may be better, but the major difference is specifying 1M vs the default of 512 bytes. I'm pretty sure i've done the default with dd of 512 bytes and it took ages.. and perhaps similarly with ddrescue. So do -b 1M at least.
Regarding -d I haven't really experimented with and without it.. it's to do with accessing the disk more directly. I've been ok with and without it, so I tend to do without it.
The 'from' goes first, and then the 'to' second so you shouldn't mix them up. But do double check.
And notice i've specified a log file.
Obviously it almost goes without saying that you can also check the manual for ddrescue
https://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html
There is a version of ddrescue that isn't good. You want GNU ddrescue. https://askubuntu.com/questions/211578/whats-the-difference-between-ddrescue-gddrescue-and-dd-rescue
You can used testdisk to read the file created by dd or ddrescue.