Repository navigation
Commit d344496
authored
fix: empty fs_uuid on multi-device Btrfs (#440)
On a multi-device Btrfs filesystem `grub-probe --target=device /` prints
one device per line (e.g. /dev/vda3 and /dev/vdb). The whole multi-line
result was then passed to `grub-probe --device "${root_device}"
--target=fs_uuid`, which cannot handle several devices at once and
returns an empty string. The blkid fallback fails for the same reason,
so grub-btrfs aborts with "Cannot determine UUID".
Pipe the device probe through `head -n1` and keep only the first member
device. Every member of a Btrfs pool reports the same pool-wide fs UUID,
so the first device is sufficient. For single-device setups `head -n1`
is a no-op, so existing configurations are unaffected.
The same one-line-per-device behaviour applies to a /boot that lives on
a multi-device Btrfs, so the identical guard is added to boot_device.
Closes #412
Refs #4251 parent a136a7c commit d344496
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
138 | | - | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| |||
0 commit comments