Skip to content

Root subvolume UUID detection issue in grub-btrfs on Debian 13 (testing) with snapper #420

@q2g748r9h8-lab

Description

@q2g748r9h8-lab

Hello,

first of all thank you for maintaining grub-btrfs.
It is a very useful project and greatly improves the usability of Btrfs snapshots.

While testing a Debian 13 (testing / trixie) installation with Btrfs and snapper, I encountered an issue where snapshots were not detected and therefore not added to the GRUB menu.

Environment:

  • Distribution: Debian 13 (testing / trixie)
  • Filesystem: Btrfs
  • Snapshot tool: snapper
  • Bootloader: GRUB
  • Package: grub-btrfs

Observed behaviour:
Running „update-grub“ did not generate snapshot entries.
During execution the following message appeared:

"UUID of the root subvolume is not available"

Root cause:
The issue appears to be related to how the script determines the UUID of the root subvolume.

In the file:
/etc/grub.d/41_snapshots-btrfs

the UUID is determined using the following command:
root_uuid_subvolume="$(btrfs subvolume show / 2>/dev/null | awk -F: '/^\sUUID/ {gsub(/^[ \t]+/, "", $2); print $2}')"

On Debian 13 this did not return a value, which caused the snapshot detection logic to fail.

Workaround
The system already correctly detects the filesystem UUID earlier in the script as:

root_uuid

Using this variable directly resolved the issue.
Example change:

before:
root_uuid_subvolume="$(btrfs subvolume show / 2>/dev/null | awk -F: '/^\sUUID/ {gsub(/^[ \t]+/, "", $2); print $2}')"

after:
root_uuid_subvolume="$root_uuid"

After applying this change and running:
update-grub

all snapper snapshots appeared correctly in the GRUB boot menu.

Additional note
The underlying issue may be related to differences in how awk or btrfs-progs format the output on Debian, which caused the UUID detection to fail.

It might help if the detection logic were made more robust or if the already detected root UUID were reused instead of parsing the subvolume output.

Thank you again for the project and your work maintaining it.

Best regards
Ralph

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions