dracutdevs / dracut

dracut the event driven initramfs infrastructure
https://github.com/dracutdevs/dracut/wiki
GNU General Public License v2.0
573 stars 396 forks source link

Support bcachefs encrypted root unlocking #2646

Open notmentaloutlaw opened 3 months ago

notmentaloutlaw commented 3 months ago

Just like how "crypt" module opens luks encrypted root via cryptsetup. It would be great if dracut could unlock bcachefs encrypted partitions a similar way. In userspace the way to unlock a bcachefs encrypted drive and mount it is:

bcachefs unlock /dev/sdaX
# type password
mount /dev/sdaX /mountpoint

However, it is a bit different on systemd for some reason where you need to specify a -k value. And from my testing in fedora 40 beta (my current system uses openrc) I had this issue where I had to type the password again when mounting it (could be a bug with fedora 40 beta).

bcachefs unlock -k session /dev/sdaX
# type password
bcachefs mount /dev/sdaX /mountpoint
# type password again

There is more of an explanation on their website https://bcachefs.org/Encryption/.