Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
matleborgne opened this issue May 29, 2024 · 0 comments
Open

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

matleborgne opened this issue May 29, 2024 · 0 comments

Comments

@matleborgne
Copy link

matleborgne commented May 29, 2024

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 :

  • from mount -o [...] /dev/disk/by-uuid/${root_uuid} [...]
  • to mount -o [...] /dev/mapper/root [...]

So I hardcoded my luks decryption name.

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

  • default (UUID is fine),
  • LABEL,
  • custom (like mapper name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant