Bcachefs is a copy-on-write file system for Linux-based operating systems.
Few days ago Kent Overstreet announced the release of Bcachefs 1.33.0 via an announcement., a new version of the file system that introduces profound structural changes in data management and in the architecture of its source code.
This update is shaping up to be one of the most significant in the last two years, focusing on metadata integrity and modernizing the C codebase.
"Reconcile": A new era for data integrity
The most notable new feature, described as the most significant change in the last two years, is the introduction of the function of Reconciliation (rebalance_v2)This new mechanism replaces the old "rebalancing" system and solves one of its biggest limitations: now the system can manage and move not only user data, but also file system metadata.
Rebalance_v2 acts proactively and automatically. If a new disk is added to an array or redundancy options are changed, Bcachefs will immediately begin replicating and correcting any degraded data or metadata, using separate indexes to prioritize critical operations. This ensures that system integrity is maintained even during intensive maintenance operations.
Code cleanup and Rust preparation
Under the hood, version 1.33.0 brings a massive restructuring of the C code to make it more secure and compatible with a future implementation in PeaceThe developer has performed a deep clean, reducing the number of statements. goto from 2.500 to just 600, which greatly simplifies the logical flow of the program.
In addition, new macros have been introduced such as DARRAY() y try()These are designed to mimic the dynamic vector behavior and error handling of Rust and C++. This not only modernizes the current code but will also facilitate portability and reduce the memory fault surface in the future.
Improved diagnostics and storage flexibility
With system administration in mind, this version drastically improves the clarity of error messagesBcachefs can now distinguish and communicate whether a failure is due to a software bug or a physical hardware problem, even suggesting the necessary recovery steps. This is vital to avoid misdiagnoses where the file system is blamed for a failing disk.
This transparency extends to several levels:
- Detailed I/O errors: When the block layer reports a failure, Bcachefs now transmits the specific code (such as
BLK_STS_IOERR), helping to identify if the physical disk is the culprit. - Assembly errors: If devices are missing to assemble a volume, the system now indicates exactly which unit is missing, showing its name and model based on the last time it was seen.
- Error rate limits: The boundaries for "soft" (software) and "hard" (hardware) errors have been separated, ensuring that a flood of minor errors does not mask a critical disk failure.
Additionally, the command bcachefs fs top It has improved. The internal counters now display data transfer speeds instead of just static numbers, making it much easier to correlate events (such as data_update_fail) with real-time performance drops.
Optimizations in Btrees and new mounting options
Under the hood, heavy-load performance is improved thanks to changes in B-tree management. Merging empty nodes now occurs asynchronously, eliminating write buffer bottlenecks. Additionally, an optional recovery pass has been added. merge_btree_nodes, to manually optimize the tree structure if necessary.
Another very practical added feature is the ability to boot a file system with the configuration replicas=2 on a single discThis allows users to start with a single drive knowing that the system "must" have redundancy; as soon as a second drive is connected, Bcachefs automatically replicates the data without requiring complex manual intervention.
Finally it is worth mentioning that the new version, now available For distributions such as Debian, Fedora, Arch Linux and NixOS, this update requires a Linux kernel 6.16 or higher and is distributed in two fundamental packages: the kernel module (bcachefs-kernel-dkms) and the user tools (bcachefs-tools).