Testing bcachefs
Bcachefs is a COW file system with RAID, snapshots and more. bcachefs homepage
It has been added to linux 6.7 and to test bcachefs I compiled linux 6.7 rc6+ (latest on master 231223) and created 40GB partition.
It feels faster than ZFS, the algorithms in bcachefs are very efficient. Send and receive are missing, it would allow us to copy snapshots to other machines and an efficient backup system (the all meta data would be sent to the receiving machine and bcachefs stores the checksums on disk, the receiving machine only compares the checksums from the sending machine whereas rsync computes the checksums in both sending and receiving machine for each run).
I saw some open data corruption bugs on the bug tracker so I think bcachefs needs more time to mature.
Installing bcachefs-tools
Clone the repo:
git clone --depth=1 https://evilpiepirate.org/git/bcachefs-tools.git
To build bcachefs-tools, rust (>1.65) and some dependencies need to be installed:
# install rust
rustup update
# or for new install
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install -y pkg-config libaio-dev libblkid-dev libkeyutils-dev liblz4-dev libsodium-dev liburcu-dev libzstd-dev uuid-dev zlib1g-dev valgrind libudev-dev udev git build-essential python3 python3-docutils libclang-dev
Build:
make
make install
Build linux
Compile a linux kernal with bcachefs enabled in .config:
CONFIG_BCACHEFS_FS=y
Setup a partition and format
fdisk /dev/sdb
bcachefs format /dev/sdb1
mkdir /mnt/bcachefs
mount /dev/sdb1 /mnt/bcachefs/
cd /mnt/bcachefs/
# create a snapshot, snapshots are writable
bcachefs subvolume snapshot ./snapshot1
# show some statistics:
bcachefs fs usage /mnt/bcachefs/
# setup compression
bcachefs set-option --compression=lz4 /dev/sdb1
# mount shows the compression option
mount
/dev/sdb1 on /mnt/bcachefs type bcachefs (rw,relatime,compression=lz4)
Hashtags: #linux #filesystems #bcachefs