add support for detached LUKS header and UUID fallbacks#378
Merged
Antynea merged 1 commit intoAntynea:masterfrom Jan 2, 2026
Merged
add support for detached LUKS header and UUID fallbacks#378Antynea merged 1 commit intoAntynea:masterfrom
Antynea merged 1 commit intoAntynea:masterfrom
Conversation
Two hard failures prevented 41-snapshots-btrfs from generating a snapshot submenu when the root LUKS header is detached and cryptdevice= uses a /dev/disk/by-id path: * grub-probe --target=fs_uuid aborted on detached headers. * grep-based extraction of UUID from GRUB_CMDLINE_LINUX_DEFAULT failed when cryptdevice= did not contain “UUID=…”. This patch: 1. Wraps grub-probe in a try/blkid/lsblk cascade that always returns the filesystem UUID or prints a clear error. 2. Replaces the fixed “cryptomount -u $(grep …UUID=…)” line with logic that: • accepts both UUID=… and /dev/disk/by-id/… syntaxes, • resolves paths to a canonical UUID with blkid, • emits ‘cryptomount -u <uuid>’ when possible, • falls back to ‘cryptomount -a’ only if no UUID can be extracted. 3. Keeps the previous behavior unchanged for unencrypted systems or for installations that already worked. Result: snapshot menu is produced and boots correctly on standard (setup with inline header), detached-header, and by-id configurations; no regression for existing users.
Owner
|
Thank you very much for that. |
|
I have a weird disk setup where the Btrfs filesystem spans two disks. So the # Fallback when grub-probe fails (encrypted container, detached header...)
if [ -z "$root_uuid" ]; then
root_uuid="$(blkid -s UUID -o value "$root_device" | tail -n1 2>/dev/null)"
fiOtherwise, I can confirm this PR works on my system (Fedora 42). |
|
Could this patch be merged? I encountered the same issue when testing LUKS-encrypted Btrfs partitions on a virtual machine (archlinux-2025.12.01-x86_64.iso); this patch does indeed fix it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two hard failures prevented 41-snapshots-btrfs from generating a snapshot submenu when the root LUKS header is detached and cryptdevice= uses a /dev/disk/by-id path:
This patch:
Wraps grub-probe in a try/blkid/lsblk cascade that always returns the filesystem UUID or prints a clear error.
Replaces the fixed “cryptomount -u $(grep …UUID=…)” line with logic that:
• accepts both UUID=… and /dev/disk/by-id/… syntaxes,
• resolves paths to a canonical UUID with blkid,
• emits ‘cryptomount -u ’ when possible,
• falls back to ‘cryptomount -a’ only if no UUID can be extracted.
Keeps the previous behavior unchanged for unencrypted systems or for installations that already worked.
Result: snapshot menu is produced and boots correctly on standard (setup with inline header), detached-header, and by-id configurations; no regression for existing users.
Please read Issue #377