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: update-grub silently fails if root filesystem is inside unsupported by GRUB2 volume #222

Closed
S-trace opened this issue Oct 18, 2022 · 0 comments · Fixed by #223
Closed

Comments

@S-trace
Copy link
Contributor

S-trace commented Oct 18, 2022

Hello.

I have a following partitions layout:
sda1 - esp
sda2 - LUKS
Inside LUKS I have LVM
Inside LVM I have regular volume "BOOT" and lvm-thin pool "THIN"
Inside THIN lvm-thin pool I have "ROOT" volume containing BTRFS.

If I run update-grub - snapshots-btrfs GRUB hook fails at root_fs=$(${grub_probe} --target="fs" /) due to set -e at the beginning of snapshots-btrfs GRUB hook without any error messages (which is awful).

If I run grub-probe --target="fs" / manually - I got following error:

grub-probe: error: disk `lvmid/DGpbHM-b8Aa-beeT-SQpo-12lY-d7a3-WGZSGu/uBMaVC-mZVD-eZjJ-GoK9-KY7P-1oRw-4lcagj' not found.

This error occurs because GRUB can't yet handle lvm-thin volumes (and because of this I have separate BOOT volume in LVM).

But the main issue is update-grub silently fails because of snapshots-btrfs GRUB hook.

Fix is simple - do not evaluate grub-probe result into variable, but use it directly in test clause:

[[ $("${grub_probe} --target="fs" /)" != "btrfs" ]] && exit 0

Failure of commands in test clause in Bash does not trigger set -v error and can be handled in script to exit gracefully.

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

Successfully merging a pull request may close this issue.

1 participant