1

My system is Manjaro (Arch) Linux. I have GNU ddrescue v1.23-1 (recently installed).

When resuming ddrescue, I mistyped the mapfile. Now I have one image and two logfiles.

On Day 1, I rescued the beginning of the disk. Day 1 command:

sudo ddrescue -vn /run/media/ab/2Nes1T/DDRnKB1 ~/kb1mapfile

On Day 2, I rescued some data towards the end of my disk. (I wanted to speed things up so I used -N and lowered -c to 32KiB, and I wanted to recover the approximate area of my sdc2 partition first. My sdc disc has a damaged filesystem so I can't ddrescue sdc2 specifically, but I can approximate its location and size with -i144000MiB -s50000MiB)

Day 2 command:

sudo ddrescue -vN -c 32KiB -i144000MiB -s50000MiB /dev/sdc /run/media/ab/2Nes1T/DDRnKB1 ~/kb1mapfileq

In both commands, I typed the image name correctly as DDRnKB1, but in Day 2's command I accidentally mistyped the mapfile as ~kb1mapfileq.

I tried to merge by using this method:

ddrescue -m logfile2 image2 image1 logfile1

Thus my merge command:

sudo ddrescue -m ~/kb1mapfileq /run/media/ab/2Nes1T/DDRnKB1 /run/media/ab/2Nes1T/DDRnKB1 ~/kb1mapfile

but ddrescue returned:

ddrescue: Infile and outfile are the same.

I guessed that I could make a copy of my image and do this:

sudo ddrescue -m ~/kb1mapfileq /run/media/ab/2Nes1T/DDRnKB1COPY /run/media/ab/2Nes1T/DDRnKB1 ~/kb1mapfile

...but my image files are almost 500GB and I feel it is a bit impractical to copy 500GB to fit the above command.

Is there a method to merge just the mapfiles (logfiles)?

1
  • Note: "damaged filesystem" doesn't make sense in this context; "damaged partition table" does. Oct 28, 2018 at 3:32

1 Answer 1

0

Use ddrescuelog --or-mapfile.

Ddrescuelog is a tool that manipulates ddrescue mapfiles

(source)

-z file
--or-mapfile=file
Perform a logical OR operation between the finished blocks in file and those in mapfile, and write the resulting mapfile to standard output. In other words, in the resulting mapfile a block is shown as finished if it was finished in either of the two input mapfiles.

(source)

Invoke this:

# but see the warning below!
ddrescuelog -z ~/kb1mapfileq ~/kb1mapfile > ~/kb1mapfile-merged

Warning: do not redirect to ~/kb1mapfile (or ~/kb1mapfileq) or you will lose it.

The result is in ~/kb1mapfile-merged. After you confirm it's right (ddrescueview is the right tool), overwrite the old mapfile (cp ~/kb1mapfile-merged ~/kb1mapfile).

2
  • After following your suggestion, I used ddrescueview to see the resulting merger and it looks correct. Many many thanks. I'm so happy for the answer, and thank you for your 'warning' too.
    – MarkB
    Oct 28, 2018 at 5:05
  • @MarkB Good idea with ddrescueview, bravo! I have edited it into my answer for future users with similar problems. Oct 28, 2018 at 8:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .