Skip to content

Base readErrors on ddrescue map file instead of errors reported to stdout #38

@bitsgalore

Description

@bitsgalore

Currently Ipmlab's ddrescue module parses ddrescue's stdout for any reported errors, and the error count is reported as readErrors. Subsequently an non-equal value of readErrors sets the success flag to false.

In theory, this could lead to false positives in case of read errors that ddrescue subsequently recovers (e.g. using additional read passes).

An alternative approach would be to replace this error count with a check on the ddrescue map file. Format documented here:

https://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html#Mapfile-structure

So basically we just need to read all data block lines and check the status character. For example:

# Mapfile. Created by GNU ddrescue version 1.23
# Command line: /usr/bin/ddrescue -b 512 -r4 -v /dev/sdb /mnt/p400/Diskette/Work/kb-f346d50a-ade4-11ed-a341-4370eb54a295/a5f7d186-adea-11ed-a341-4370eb54a295/a5f7d186-adea-11ed-a341-4370eb54a295.img /mnt/p400/Diskette/Work/kb-f346d50a-ade4-11ed-a341-4370eb54a295/a5f7d186-adea-11ed-a341-4370eb54a295/a5f7d186-adea-11ed-a341-4370eb54a295.map
# Start time:   2023-02-16 12:11:23
# Current time: 2023-02-16 12:12:54
# Finished
# current_pos  current_status  current_pass
0x00019200     +               4
#      pos        size  status
0x00000000  0x00019000  +
0x00019000  0x00001000  -
0x0001A000  0x0009A000  +

Here we have three blocks, with:

  • Block 1: finished block ("+" char)
  • Block 2: failed block bad-sector(s) ("-" char)
  • Block 3: finished block ("+" char)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions