1


I would like to have some details about how the --retrim option works in gnu ddrescue.
Does it behave the same way as the regular trimming?
AFAIK, in the first trimming phase, the utility goes to the first sector and to the last sector and read the sectors one by one forward and backward until it reaches bad sectors.
If --retrim behaves the same way, i don't see any advantage since the same areas would be marked as bad.

Othman
  • 155
  • 2
  • 6

1 Answers1

3

gddrescue normally trims once and won't retry by default if you ran the gddrescue command again with the same log file.

The --retrim flag just tells gddrescue to try trimming again. The retry might result in more successful trims, according to the official documentation:

--retrim

Mark all failed blocks inside the rescue domain as non-trimmed before beginning the rescue. The effect is similar to '--retry-passes=1', but the bad sectors are tried in a different order, making perhaps possible to rescue some of them.

Deltik
  • 19,603
  • Thanks for your answer but i still don't understand. After a trim, we know that the 1st and the last sector of the blocks are bad. If --retrim uses the same algorithm as trim, i don't see the purpose, we'll obtain the same result if we are unable to read them. If retrim does something else like jumping inside the bad area, than maybe this is interesting. – Othman Sep 28 '15 at 07:51
  • Well, @Othman, it's mostly just "I'll try trimming again; pray this works." There's not much more to it. Newer versions of gddrescue have defined a feature called "scraping". You can read about it in the documentation. – Deltik Sep 28 '15 at 07:55
  • I'm currently running a retrim on a recovery that still had a number of errors. It successfully was able to read about 70 more sectors thus far and got the number of errors down to 285 (from an original 355). But I now look and the Error is reading 294. Shouldn't that number only go down on a re-scan 'retrim' pass? – Scott Jan 12 '18 at 16:40
  • 1
    @Scott: Retrims can make the error count go down by successfully reading through an entire block, but the next phase, scraping can increase the error count by successfully reading sectors between two trim endpoints, essentially making two smaller error segments. You may be able to see this in action with ddrescueview. You can find more details about scraping in the ddrescue manual. – Deltik Jan 12 '18 at 18:16
  • cool, ty! I figured it was something like that going on – Scott Jan 17 '18 at 18:30