Bcachefs Repair Code Reaching Complete & Robust Recovery

Written by Michael Larabel in Linux Storage on 3 April 2024 at 08:08 PM EDT. 29 Comments
LINUX STORAGE
Just two days after a Linux 6.9 pull request was submitted for Bcachefs to better cope with "extreme file-system damage", another pull request for this current cycle was submitted that aims to improve the recovery capabilities of this newer copy-on-write open-source file-system.

While more than one thousand lines of new code, this latest pull request aims to sharply improve the Bcachefs repair capabilities. It's being sent in still at this stage of the Linux 6.9 "fixes" stage of the kernel cycle as at least it should be more robust now in helping to recover from file-system mishaps. Bcachefs lead developer Kent Overstreet notes that with these latest patches the file-system's repair code "should be complete" and if not he wants to immediately hear of any issues.

SSDs


Overstreet explained in the pull request bringing up the Bcachefs repair code to good shape:
"A couple more small fixes, and new repair code.

We can now automatically recover from arbitrary corrupted interior btree nodes by scanning, and we can reconstruct metadata as needed to bring a filesystem back into a working, consistent, read-write state and preserve access to whatevver wasn't corrupted.

Meaning - you can blow away all metadata except for extents and dirents leaf nodes, and repair will reconstruct everything else and give you your data, and under the correct paths. If inodes are missing i_size will be slightly off and permissions/ownership/timestamps will be gone, and we do still need the snapshots btree if snapshots were in use - in the future we'll be able to guess the snapshot tree structure in some situations.

IOW - aside from shaking out remaining bugs (fuzz testing is still coming), repair code should be complete and if repair ever doesn't work that's the highest priority bug that I want to know about immediately.

This patchset was kindly tested by a user from India who accidentally wiped one drive out of a three drive filesystem with no replication on the family computer - it took a couple weeks but we got everything important back."

The code now awaits pulling by Linus Torvalds for further enhancing the Bcachefs quality on the mainline kernel.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week