Getting Started

Installation

bcachefs is distributed as a DKMS module (like ZFS). Your distribution's bcachefs-tools package includes everything you need: the kernel module and userspace tools.

Arch, NixOS: Install bcachefs-tools from your package manager - you're done.

Debian, Ubuntu:

curl -fsSL https://apt.bcachefs.org/signing-key.asc | sudo tee /etc/apt/keyrings/bcachefs.asc
echo "deb [signed-by=/etc/apt/keyrings/bcachefs.asc] https://apt.bcachefs.org $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/bcachefs.list
sudo apt update && sudo apt install bcachefs-tools bcachefs-dkms

Fedora:

sudo dnf copr enable ngompa/bcachefs
sudo dnf install bcachefs-tools

OpenSUSE: See https://build.opensuse.org/package/show/filesystems:bcachefs:release/bcachefs

Basic usage

Format and mount a single device:

bcachefs format /dev/sda1
mount -t bcachefs /dev/sda1 /mnt

Multi-device filesystem

For a tiered setup with sda1 (fast SSD) caching sdb1 (slow HDD):

bcachefs format /dev/sd[ab]1 \
    --foreground_target /dev/sda1 \
    --promote_target /dev/sda1 \
    --background_target /dev/sdb1
mount -t bcachefs /dev/sda1:/dev/sdb1 /mnt

Writes buffer to the fast device and migrate to the slow device in the background. Hot data gets promoted back to the fast device automatically.

Next steps

See bcachefs format --help for all options, or read the full User manual for detailed documentation on all features.