Antynea / grub-btrfs

Include btrfs snapshots at boot options. (Grub menu)
GNU General Public License v3.0
688 stars 73 forks source link

BUG: Fail to mount rootfs on /tmp/grub-btrfs in Alpine Linux #332

Open matleborgne opened 1 month ago

matleborgne commented 1 month ago

Summary On Alpine Linux 3.20 full-disk-encryption with LUKS on BTRFS, grub-mkconfig fails to mount rootfs with the following message :

mount: /tmp/grub-btrfs.r8w0neyqd5: special device /dev/disk/by-uuid/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx does not exist.
       dmesg(1) may have more information after failed mount system call.

By the way I use btrbk, but this is not the point.

Issue identification The main problem comes from Alpine : by default, it uses mdev from busybox. Strangely, it seems to not detect every partition and "reference" it on /dev.

I don't have either /dev/disk/by-uuid/... or /dev/disk/by-label/... concerning my rootfs. I have some filesystems, yes, but not all of them.

The second issue is that /etc/grub.d/XX-grub-btrfs config file does use the UUID of rootfs. And I did not find a way to configure it through the config file in /etc/default/grub-btrfs/config or with the openrc config file.

Workaround My current workaround is very very veryyyyy dirty but I do not have time to code and make a pull request.

I change the line number 596 in /etc/grub.d/XX-grub-btrfs :

So I hardcoded my luks decryption name.

I think it would be cleaner to create a config option to modify the mountpoint entry :