>>40193900>>40193762Additional information: ddrescue uses a map file and either another drive or image (raw, I think) as output. The map file is used to keep track of tried and not-tried sectors. Further, it lets you continue from where you left of if something should happen, like a sudden shutdown.
The map file can be named anything and - as you might know - doesn't require an extension.
Dunno if this is debian or ubuntu, but it should work with read-only boot media as well as long as you have an internet connection:
- download ddrescue and extract it
- Install a c++ compiler: apt install build-essentials
- compile using "make" and "make install" (dunno if you had to just be in the folder with your terminal session, or give the paths as arguments off the top of my head)
- get your source drive (and target drive, if using that mode) from the output of this: lsblk -o NAME,FSTYPE,SIZE,LABEL,TYPE,MODEL
(optionally, you can get the serials (I think) using dmidecode -t system)
- For writing to image, you can either do it "staged" or do the entire thing in one go:
>staged (pretty much just copied from the gnu site for ddrescue):ddrescue -i0 -s50MiB [source drive] [image file] [map file]
ddrescue -i0 -s1MiB -d -r3 [source drive] [image file] [map file]
ddrescue -i30GiB -s10GiB [source drive] [image file] [map file]
ddrescue -i230GiB -s5GiB [source drive] [image file] [map file]
ddrescue [source drive] [image file] [map file]
ddrescue -d -r3 [source drive] [image file] [map file]
>all in oneuse the last two commands only
The -d -r3 arguments mean:
-d direct disc access for the source
-r3 three retries - you can alter this to your liking, but I recommend doing the non-retry run for the entire drive first, as retries add strain to the drive
Further, you can write the images to a drive:
ddrescue -f [image file] [target drive]
Or copy from disk to disk directly:
ddrescue -d -f -r3 [source drive] [target drive]