Hopefully the long term solution is kernel 5.10's mount -o ro,rescue=all will allow normal navigation and copy out of a corrupt file, complain about csum errors but not EIO?
mount -o ro,rescue=all
Short term, we probably need a how to do this in 'btrfs restore'. Because I've already gotten this question as a hypothetical, as folks realize most application give up on EIO, effectively meaning their file is stuck. Somehow we need a program that will tolerantly read the file without giving up.
Today is painful to just get the file out of a file system that isn't even damaged.
Actual steps needed:
btrfs restore --list-roots
btrfs insp dump-t -t 1 /dev/whatever | grep -A1 'ROOT_REF rootid'
btrfs restore -i -v -r 265 /dev/whatever --path-regex ^/(|home(|/username(|/Desktop(|/.*))))$ /path/to/restore/to/
Requested steps:
--subvol
--path-file
Or maybe someone knows of a regex calculator? I can't find one that gives a regex that restore will eat. Maybe there's a regex bug here or possibly I'm being mislead by the man page's regex example. Or maybe I just need to drink a lot of whiskey before doing regex...
Maybe ddrescue can read all of the file, except the bad block(s) that EIO. In that case it's a big 4K hole for each bad block, but similar to any bad sector recovery. If the user wants the data in those blocks, they'd need to use btrfs rescue for a more complete recovery, such as it is.
btrfs rescue
Login to comment on this ticket.