2

I ultimately would like to know which files in images generated by (g)ddrescue are affected by damage.


gddrescue (command ddrescue) is a tool for recovering data from damaged media.

When specifying the /dev/device and output.file, a logfile or mapfile can be specified as well, which is highly recommended.

Such a logfile or mapfile some relevant information for being able to resume the recovery process at any time after interruption, which includes a list of damaged areas on the data storage device.

If I have a gddrescue mapfile/logfile, how do I generate a plain list of unreadable LBA's from it?

The mapfile / logfile contains a list of which bytes (hexadecimal numbers) of the source drive is damaged.

It may look like this:

#      pos        size  status
0x00000000  0x00001000  +
0x00001000  0x00002000  -
0x00003000  0x0000A000  +

0x00001000 bytes are 2048 bytes.
In this example, LBA 2 and 3 are unreadable. LBA 1, 4, 5,6,7,8,9,10,11,12,13 and 14 are readable.

From the manual:

Character Meaning
'?' copying non-tried blocks
'*' trimming non-trimmed blocks
'/' scraping non-scraped blocks
'-' retrying bad sectors
'F' filling specified blocks
'G' generating approximate mapfile
'+' finished

How can the information in that logfile be used to generate a list of unreadable LBA's?

The badblocks command finds 0 bad blocks from a loop device created from that image file. http://unix.stackexchange.com/questions/459154/list-bad-blocks-and-affected-files

It would be good as well if the loop device could simulate unreadability in areas on the HDD listed in the mapfile/logfile generated by gddrescue.

  • Somebody downvoted this question without explanation. Excuse me, but if haters are not able to explain the reason for their downvote, their vote should be considered invalid. – neverMind9 Oct 19 '18 at 12:41
  • I clarified the question now and consider it as suitable for being re-opened. – neverMind9 Oct 20 '18 at 23:36
  • Here is something called gddrescuelog. I will take a better look at it: gnu.org/software/ddrescue/manual/…. – neverMind9 Nov 9 '18 at 17:10
0

gddrescuelog is dedicated to that purpose. https://www.systutorials.com/docs/linux/man/1-ddrescuelog/

The -c option or --create-mapfile option allows you to create a mapfile, as long as you can provide the correct --block-size or -b, which is usually 512 on flash drives and hard drives and 2048 on optical discs.

The -l, --list-blocks option allows to do the same in reverse, with a given --block-size, generating lists of unreadable LBA's. The mapfile just is a list of hexadecimally listed bytes readable and non-readable. You can output it into >>a_file.list.txt as well.

Manual man ddrescuelog: https://www.systutorials.com/docs/linux/man/1-ddrescuelog/ .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.