User:Lekto/How to boot from multi-device Bcachesfs using grub and Dracut.

From Gentoo Wiki
Jump to:navigation Jump to:search

Nor Grub (2.12 and 9999 from 29th April 2025) nor Dracut (106) can’t be easily use to boot from a multi-device Bcachefs root. Grub-mkconfig will fail because it doesn’t know what /dev/sda2:/dev/sdb1 is, and Dracut will fail while trying to mount it. It is still possible to boot from it, but it requires some manual work.

Grub

It is impossible to use grub-mkconfig to create grub.cfg, but the file can be created manually; for example:

FILE /boot/grub/grub.cfg
set timeout=5
insmod all_video

menuentry '6.12.16' {
        echo    'Loading kernel...'
        linux   /kernel-6.12.16-gentoo-dist

        echo    'Loading initrmfs...'
        initrd  /initramfs-6.12.16-gentoo-dist.img

        echo    'Booting...'
}

It is important to not specify root= here; at best it will do nothing or it can lock the boot process in an infinite wait loop.

Dracut

Dracut doesn’t understand Bcachefs. It doesn’t know what to do with /dev/sda2:/dev/sdb1, even if rootfstype is specified. If Dracut gets a UUID, it will try to mount the filesystem with the first device with that UUID, which is impossible in the Bcachefs case. When Dracut drops to the rescue shell during the boot, the filesystem has to be mounted manually; for example:

root #mount -t bcachefs /dev/sda2:dev/sdb1 /sysroot && exit