Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bitsgalore opened this issue Feb 27, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@bitsgalore
Copy link
Member

bitsgalore commented Feb 27, 2023

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)
@bitsgalore bitsgalore added the enhancement New feature or request label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant