This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

14
Need help simply reading a corrupted file
Post Body

A year or so ago I had an incident resulting in some minor corruption, presumably bit flips, for about a dozen video files, they're mkv, whatever, it's fine, I can remux them if they don't just continue to play perfectly fine.

Yesterday I ended up needing to read them, I'm working on getting backups setup, and I encounter extremely consistent IO errors, turns out it's ZFS raising them when the checksums for a block don't match, cool, that's actually a damn good feature, but I do want to read the data anyway, after a few hours of googling and asking in some discord servers my current possible solutions are pretty dire...
zfs set checksums=off or read the file block-by-block using zdb, I don't have any experience doing something exactly like that so I'd rather not mess around with zdb if possible.

I'm running TrueNAS 12.0-U8, raidz2, my pool is healthy.

What should I do?

E: Would making my pool read-only and then temporarily setting checksums to off be a good idea? E2: Solved, thanks /u/Maltz42 !
OpenZFS versions 2.1.0 and above support zdb -r for exactly this purpose.
Example command that worked for me on TrueNAS: zdb -U /data/zfs/zpool.cache -r Boys {folder}/test.test /mnt/Boys/{folder}/test2.test2
note: truenas has the zpool.cache for non-bootpool pools at a different location, hence the -U argument.
E3: ugh I can't believe I celebrated so prematurely, it errors out on corrupted files too, wtf even is the point of this command... I've wasted over 12 hours of my life on this

E4: Gave in and delved into the ZDB block-dumping fun-ness, I'm working on a python script to make dumping somewhat easy, will post to GH and hotlink post-haste.
E5: done, https://github.com/tntmod54321/zdb-recover
that was a colossal pain in the ass but hope it helps others, I made it read blocks normally and retry using zdb if the blocks are bad, compared to the 41KB/s I was getting using only zdb to read blocks, it's nearly full speed..

Author
Account Strength
100%
Account Age
8 years
Verified Email
Yes
Verified Flair
No
Total Karma
13,625
Link Karma
1,787
Comment Karma
11,820
Profile updated: 3 days ago
Posts updated: 6 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago