bcachefs
Manage and create Bcachefs filesystems
TLDR
Format a partition with bcachefs
Mount a bcachefs filesystem
Create a RAID 0 filesystem where an SSD acts as a cache and an HDD acts as a long-term storage
Mount a multidevice filesystem
Display disk usage
Set replicas after formatting and mounting
Force bcachefs to ensure all files are replicated
Create a snapshot of a particular directory
SYNOPSIS
bcachefs [global-options] <subcommand> [subcommand-options] [arguments]
PARAMETERS
-C, --config=<FILE>
Read configuration from FILE instead of default
-d[<LEVEL>], --debug[=<LEVEL>]
Enable debug logging at specified level (0-31)
--version
Print bcachefs version and exit
--help
Show usage help
daemon
Start, stop, or query kernel daemon threads for devices
format [<options>] <device>...
Format devices into new bcachefs filesystem (mkfs.bcachefs symlink)
fsck [<options>] <device>
Check filesystem integrity and repair issues (fsck.bcachefs symlink)
rescue <subcmd>
Recovery tools: superblock, key, uuid, devices, etc.
version
Print detailed version information
kernel-config
Dump/print kernel config options used by bcachefs
DESCRIPTION
bcachefs is a next-generation Linux filesystem designed for high performance, reliability, and advanced features like copy-on-write (COW), snapshots, built-in RAID (including erasure coding), compression, deduplication, and encryption. It combines the best of Btrfs, ZFS, and ext4 while addressing their shortcomings through a novel b-tree based design for both metadata and data.
The bcachefs command-line tool manages bcachefs volumes, devices, and filesystems. Key operations include formatting devices (bcachefs format), filesystem checks and repairs (bcachefs fsck), data recovery (bcachefs rescue), and querying status. It supports multi-device setups for redundancy and performance, with automatic balancing and scrubbing.
Developed by Kent Overstreet, bcachefs emphasizes simplicity in code and configuration. The userspace tools integrate with kernel module (CONFIG_BCACHEFS_FS) for mounting via mount.bcachefs. Ideal for servers needing robust storage without complex management.
CAVEATS
Relatively new filesystem (kernel 6.7+); test thoroughly, backup data before format/fsck/rescue. Some features experimental; distro support varies. Multi-device requires careful planning to avoid data loss.
KEY FEATURES
Snapshots, subvolume-aware, RAID 0/1/5/6/10, zstd/lzo compression, chunk dedup, LSKC encryption, fast balancing/scrubbing.
MOUNTING
Use mount -t bcachefs or mount.bcachefs; options like compression=zstd, replicas=2.
HISTORY
Created by Kent Overstreet ~2015 as bcache evolution. Years of development with public git tree. Merged to Linux 6.7 (Dec 2023) after rigorous review. Userspace tools track kernel closely.
SEE ALSO
mount.bcachefs(8), mkfs.bcachefs(8), fsck.bcachefs(8), btrfs(8), zfs(8)


