Bcachefs

Last updated
Bcachefs
Developer(s) Kent Overstreet
Introduced21 August 2015;8 years ago (2015-08-21)
Structures
Directory contentsHybrid B+ tree
File allocationExtents
Bad blocksNone recorded
Features
Dates recordedmodification (mtime), attribute modification (ctime), access (atime), create (crtime)
AttributesExtended attributes
File system
permissions
POSIX (+ ACL in xattrs)
Transparent
compression
Yes
Transparent
encryption
Yes
Copy-on-write Yes
Other
Supported
operating systems
Linux
Website bcachefs.org

Bcachefs is a copy-on-write (COW) file system for Linux-based operating systems. Its primary developer, Kent Overstreet, first announced it in 2015, and it was added to the Linux kernel beginning with 6.7. [1] [2] It is intended to compete with the modern features of ZFS or Btrfs, and the speed and performance of ext4 or XFS.

Contents

Features

Bcachefs is a copy-on-write (COW) file system for Linux-based operating systems. [3] Features include caching, [4] full file-system encryption using the ChaCha20 and Poly1305 algorithms, [5] native compression [4] via LZ4, gzip [6] and Zstandard, [7] snapshots, [4] CRC-32C and 64-bit checksumming. [3] It can span block devices, including in RAID configurations. [5]

Earlier versions of Bcachefs provided all the functionality of Bcache, a block-layer cache system for Linux, with which Bcachefs shares about 80% of its code. [8] As of December 2021, the block-layer cache functionality has been removed. [7]

On a data structure level, bcachefs uses B-trees like many other modern file systems, but with an unusually large node size defaulting to 256 KiB. These nodes are internally log-structured, forming a hybrid data structure, reducing the need for rewriting nodes on update. [9] Snapshots are not implemented by cloning a COW tree, but by adding a version number to filesystem objects. [10] The COW feature and the bucket allocator enables a RAID implementation which is claimed to not suffer from the write hole nor IO fragmentation. [7]

Stability

Bcachefs describes itself as "working and stable, with a small community of users". [11] When discussing Linux 6.9-rc3 on April 7, 2024, Linus Torvalds touched on the stability of bcachefs, saying "if you thought bcachefs was stable already, I have a bridge to sell you". [12]

History

Primary development has been by Kent Overstreet, the developer of Bcache, which he describes as a "prototype" for the ideas that became Bcachefs. Overstreet intends Bcachefs to replace Bcache. [8] Overstreet has stated that development of Bcachefs began as Bcache's developers realized that its codebase had "been evolving ... into a full blown, general-purpose POSIX filesystem", and that "there was a really clean and elegant design" within it if they took it in that direction. Some time after Bcache was merged in 2013 into the mainline Linux kernel, Overstreet left his job at Google to work full-time on Bcachefs. [3]

After a few years' unfunded development, Overstreet announced Bcachefs in 2015, at which point he called the code "more or less feature complete", and called for testers and contributors. He intended it to be an advanced file system with modern features [13] like those of ZFS or Btrfs, with the speed and performance of file systems such as ext4 and XFS. [3] As of 2017 Overstreet was receiving financial support for the development of Bcachefs via Patreon. [5]

As of mid-2018, the on-disk format had settled. [8] Patches had been submitted for review to have Bcachefs included in the mainline Linux kernel, but had not yet been accepted. [4]

By mid-2019, the desired features of Bcachefs were completed and the associated patches to LKML were submitted for peer review. [14] [15] In September 2023 the filesystem was merged in linux-next, a development tree of the Linux kernel where new features are tested before inclusion in the mainline tree. [16]

In October 2023 Bcachefs was merged into the Linux 6.7 kernel, [17] which was released in January 2024. [2]

Related Research Articles

XFS is a high-performance 64-bit journaling file system created by Silicon Graphics, Inc (SGI) in 1993. It was the default file system in SGI's IRIX operating system starting with its version 5.3. XFS was ported to the Linux kernel in 2001; as of June 2014, XFS is supported by most Linux distributions; Red Hat Enterprise Linux uses it as its default file system.

ReiserFS is a general-purpose, journaling file system initially designed and implemented by a team at Namesys led by Hans Reiser and licensed under GPLv2. Introduced in version 2.4.1 of the Linux kernel, it was the first journaling file system to be included in the standard kernel. ReiserFS was the default file system in Novell's SUSE Linux Enterprise until Novell decided to move to ext3 for future releases on October 12, 2006.

ext2, or second extended file system, is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext). Having been designed according to the same principles as the Berkeley Fast File System from BSD, it was the first commercial-grade filesystem for Linux.

ext3, or third extended filesystem, is a journaled file system that is commonly used by the Linux kernel. It used to be the default file system for many popular Linux distributions. Stephen Tweedie first revealed that he was working on extending ext2 in Journaling the Linux ext2fs Filesystem in a 1998 paper, and later in a February 1999 kernel mailing list posting. The filesystem was merged with the mainline Linux kernel in November 2001 from 2.4.15 onward. Its main advantage over ext2 is journaling, which improves reliability and eliminates the need to check the file system after an unclean shutdown. Its successor is ext4.

Reiser4 is a computer file system, successor to the ReiserFS file system, developed from scratch by Namesys and sponsored by DARPA as well as Linspire. Reiser4 was named after its former lead developer Hans Reiser. As of 2021, the Reiser4 patch set is still being maintained, but according to Phoronix, it is unlikely to be merged into mainline Linux without corporate backing.

A kernel is a component of a computer operating system. A comparison of system kernels can provide insight into the design and architectural choices made by the developers of particular operating systems.

Squashfs is a compressed read-only file system for Linux. Squashfs compresses files, inodes and directories, and supports block sizes from 4 KiB up to 1 MiB for greater compression. Several compression algorithms are supported. Squashfs is also the name of free software, licensed under the GPL, for accessing Squashfs filesystems.

The following tables compare general and technical information for a number of file systems.

ext4 is a journaling file system for Linux, developed as the successor to ext3.

Btrfs is a computer storage format that combines a file system based on the copy-on-write (COW) principle with a logical volume manager, developed together. It was founded by Chris Mason in 2007 for use in Linux, and since November 2013, the file system's on-disk format has been declared stable in the Linux kernel.

HAMMER is a high-availability 64-bit file system developed by Matthew Dillon for DragonFly BSD using B+ trees. Its major features include infinite NFS-exportable snapshots, master–multislave operation, configurable history retention, fsckless-mount, and checksums to deal with data corruption. HAMMER also supports data block deduplication, meaning that identical data blocks will be stored only once on a file system. A successor, HAMMER2, was announced in 2011 and became the default in Dragonfly 5.2.

<span class="mw-page-title-main">Linux kernel</span> Operating system kernel

The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally written in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU operating system, which was written to be a free (libre) replacement for Unix.

<span class="mw-page-title-main">OpenZFS</span> Open-source implementation of the ZFS file system

OpenZFS is an open-source implementation of the ZFS file system and volume manager initially developed by Sun Microsystems for the Solaris operating system and now maintained by the OpenZFS Project. It supports features like data compression, data deduplication, copy-on-write clones, snapshots, and RAID-Z. It also supports the creation of virtual devices, which allows for the creation of file systems that span multiple disks.

bcache is a cache in the Linux kernel's block layer, which is used for accessing secondary storage devices. It allows one or more fast storage devices, such as flash-based solid-state drives (SSDs), to act as a cache for one or more slower storage devices, such as hard disk drives (HDDs); this effectively creates hybrid volumes and provides performance improvements.

In the Linux kernel, kernfs is a set of functions that contain the functionality required for creating the pseudo file systems used internally by various kernel subsystems so that they may use virtual files. For example, sysfs provides a set of virtual files by exporting information about hardware devices and associated device drivers from the kernel's device model to user space.

Zstandard is a lossless data compression algorithm developed by Yann Collet at Facebook. Zstd is the corresponding reference implementation in C, released as open-source software on 31 August 2016.

Stratis is a user-space configuration daemon that configures and monitors existing components from Linux's underlying storage components of logical volume management (LVM) and XFS filesystem via D-Bus.

EROFS is a lightweight read-only file system initially developed by Huawei, originally for the Linux kernel and now maintained by an open-source community from all over the world.

This article documents the version history of the Linux kernel. The Linux kernel is a free and open-source, monolithic, Unix-like operating system kernel. It was conceived and created in 1991 by Linus Torvalds.

References

  1. "kernel/git/torvalds/linux.git - Linux kernel source tree". git.kernel.org. Retrieved 2023-10-31.
  2. 1 2 Larabel, Michael (2024-01-07). "Linux 6.7 Released With Bcachefs, Intel Meteor Lake In Good Shape & Nouveau GSP Support". www.phoronix.com. Retrieved 2024-01-07.
  3. 1 2 3 4 Larabel 2015.
  4. 1 2 3 4 Larabel 2018.
  5. 1 2 3 Baader 2017.
  6. "Options — bcachefs documentation".
  7. 1 2 3 Overstreet, Kent (18 Dec 2021). "bcachefs: Principles of Operation" (PDF). Retrieved 10 May 2023.
  8. 1 2 3 Edge 2018.
  9. "Architecture". bcachefs.org.
  10. "Snapshots". bcachefs.org.
  11. "bcachefs.org". Archived from the original on 2024-04-03.
  12. Torvalds, Linus (2024-04-07). "Linux 6.9-rc3". Linux kernel mailing list (Mailing list).
  13. Jackson 2015.
  14. LKML 2021.
  15. LKML 2022.
  16. "Bcachefs Merged Into Linux-Next". www.phoronix.com. Retrieved 2023-09-12.
  17. "Bcachefs Merged Into The Linux 6.7 Kernel". www.phoronix.com. Retrieved 2023-10-31.

Works cited