Skip to content

Commit

Permalink
Fix get_disklabel_type() not returning anything for multipath devices
Browse files Browse the repository at this point in the history
Without this fix, get_disklabel_type() used to find the Grub device to
install Grub on was returning nothing when the disk was a multipath
device, leading to the error below:
~~~
2024-10-22 10:10:05.114081935 Determining where to install GRUB2 (no GRUB2_INSTALL_DEVICES specified)
 :
+++ get_disklabel_type /dev/mapper/0QEMU_QEMU_HARDDISK_OSDISK
+++ local component disk size label junk
+++ disk=
+++ read component disk size label junk
++++ grep '^disk /dev/mapper/0QEMU_QEMU_HARDDISK_OSDISK ' /var/lib/rear/layout/disklayout.conf
+++ test
+++ return 1
++ label=
++ return 1
 :
2024-10-22 10:10:05.148970198 Failed to install GRUB2 - you may have to manually install it
~~~

The reason for this is the disklayout contains a line starting with
*multipath* but ReaR code searches for *disk* only.

Signed-off-by: Renaud Métrich <[email protected]>
  • Loading branch information
rmetrich committed Oct 22, 2024
1 parent b6aa46e commit 2904b96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr/share/rear/lib/layout-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ function get_disklabel_type () {

disk=''

read component disk size label junk < <(grep "^disk $1 " "$LAYOUT_FILE")
read component disk size label junk < <(grep -E "^(disk|multipath) $1 " "$LAYOUT_FILE")
test $disk || return 1

echo $label
Expand Down

0 comments on commit 2904b96

Please sign in to comment.