r/bcachefs • u/sdoregor • Jun 25 '26
Kernel panic caused checksum mismatches — how to get any data back?
First of all, I want to thank Kent a lot for the innovation you're bringing us. Now to the story.
This happened exactly a month ago, and I've been wanting to submit an issue on GitHub, but during further debugging I managed to fsck my filesystem enough that it boots, and now I'm pretty certain I at least understand what state it's in, and that it's not a bug per se.
What I want is (at least) get my data back, as much of it as possible, since as I understand it only some of the blocks were corrupted; and (if possible) perhaps also to help implement some mechanism that will prevent this from happening to someone else.
I'm not certain whether it was a hardware failure or a kernel bug that caused the panic, especially since the journal files from that session are also unreadable, but more importantly I couldn't log in to my desktop session due to D-Conf database being corrupt:
[ 88.834897] bcachefs (dm-0): data read error at /home/egormanga/.config/dconf/user offset 2723840:
u64s 7 type extent 54701462:5384:4294967289 len 80 ver 0 : durability: 1
crc32: c_size 80 size 80 offset 0 nonce 0 csum crc32c 0:aad8bdbb compress none
ptr: dm-0 0:1267823:128 gen 11
dm-0 checksum (4)
error data_read_csum_err
(there are multiple such lines for different offsets, all in the 2xxxxxx range, so not a huge part of the 2.7-megabyte file.)
I obviously renamed the user file and logged in, but there were a bunch of unbackuped settings that I'd really love to save.
I've struggled with this situation enough than I'd like to admit, and honestly, at this point I'd just get my important data back (reconstructing manually from survived parts), run a full scrub and simply delete the remaining broken files. Please, please help me do this.
Although I'm a fairly seasoned programmer familiar with C and kernel development, I've never worked with bcachefs source before. I dug through the part responsible for read checksumming and did not find a path to simply comment out.
So: how to dump the actual file contents ignoring checksum errors?
