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

sg_dd adaptive bpt during "Medium, hardware or blank check error but no lba of failure in sense" errors #54

Open
Bob-O-Rama opened this issue Sep 25, 2024 · 0 comments

Comments

@Bob-O-Rama
Copy link

Bob-O-Rama commented Sep 25, 2024

When using sg_dd to recover data from error prone older SCSI devices, e.g.

sg_dd retries=6 coe=1 bs=256 bpt=128 if=/dev/sg2 of=image.dd

sg_dd will prematurely terminate the copy with "Medium, hardware or blank check error but no lba of failure in sense" when bpt > 1. Setting bpt=1 lets sg_dd complete copying the whole disk, but about 140x slower. Setting coe=2, as expected, does not alter the outcome as the underlying failure produces the same unhelpful sense data.

I started trying to add some logic to enable dynamically changing the bpt in response to these conditions. Though I'm not sure how much that would break things throughout, hoping for some guidance as to where that would be easy to do or hard to do. At this point I'd settle for if that error is encountered, the BPT is dumbed down to 1 for the next retries until the the next BPT boundary is crossed to honor sectors / track. A more elaborate version would float the value up / down depending on the health of the media as seen in the retry count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant