bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-ddrescue] Questions regarding copying algorithm


From: Antonio Diaz Diaz
Subject: Re: [Bug-ddrescue] Questions regarding copying algorithm
Date: Fri, 31 Jan 2014 20:45:17 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

Hello Bret.

Bret Quigley wrote:
Firstly, thank you so much for creating such a remarkably effective tool. I
have a friend who has a bad habit of dropping laptops, and ddrescue has
helped a ton in the past.

Glad to know that ddrescue helped you.


Apologies that this is not a bug report, but simply a few questions
regarding the phase one "copying" algorithm. I'm sure that the information
is right in front of me in the source code, but I'm unfortunately not
familiar with C++.

I hope some day all the info will be in the manual. I try to clarify the manual every time I receive questions like yours.


From the manual, the copying phase "read[s] the non-tried parts of the
input file, marking the failed blocks as non-trimmed and skipping beyond
them, until all the rescue domain is tried."

My reading of this is that ddrescue tries to copy the number of sectors
specified in --cluster-size as a block, and that the block is marked as
non-trimmed (*) or finished (+) in the logfile depending on the result.
Why, then, do I see some blocks marked as bad-sector (-) during the copying
phase? Shouldn't that not occur until the trimming phase, when the sectors
are read individually?

The copying phase also tries to read individual sectors after skipping over a bad block. These sectors, if failed, are marked as bad-sector. See lines 137-138 of rescuebook.cc:

      const int alignment = skip_size ? hardbs() : softbs();
      Block b( pos, alignment );


Secondly, I was wondering what relationship, if any, exists between
--cluster-size and --skip-size. If ddrescue tries and fails to copy a
block, is the next position calculated from the beginning or end of the
block that just failed?

There is no relation between them. The size to skip is calculated from the end of the block that just failed.


Thirdly, the manual states that "slow areas are also skipped and tried
later in additional passes (before trimming)." I was wondering how this is
reflected in the logfile. In other words, if a block is copied slowly, and
ddrescue skips ahead as a result, are the skipped blocks simply left as
non-tried?

Yes, because the skipped blocks have not been tried and may be that they are not slow at all.


Regards,
Antonio.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]