Skip to content

Instantly share code, notes, and snippets.

@RlndVt
RlndVt / bcachefs mounting.md
Last active December 20, 2024 23:04
Mounting a encrypted bcachefs array at boot with a passphrase file.

How I mount my encrypted bcachefs array at boot.

In /etc/fstab/ include a x-systemd.requires=unlock-bcachefs-vault.service mount option. This service does the unlocking before the mount is triggered. Example line as in my /etc/fstab:

UUID=bf512699-6643-4d96-a793-daaf3f1d34f1 /mnt/vault bcachefs nofail,x-systemd.requires=unlock-bcachefs-vault.service 0 0

The content of the unlock service:

Bus 001 Device 003: ID 06cb:00bd Synaptics, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 16
bDeviceProtocol 255
bMaxPacketSize0 8
idVendor 0x06cb Synaptics, Inc.