rear/rear-bz2049091.patch
Pavel Cahyna c4a50be38c Apply upstream PR#2750
Avoid exclusion of wanted multipath devices when many multipath devices
are present

Resolves: rhbz2049091
2022-02-21 15:56:42 +01:00

26 lines
1.5 KiB
Diff

diff --git a/usr/share/rear/layout/save/default/335_remove_excluded_multipath_vgs.sh b/usr/share/rear/layout/save/default/335_remove_excluded_multipath_vgs.sh
index 040e9eec..e731c994 100644
--- a/usr/share/rear/layout/save/default/335_remove_excluded_multipath_vgs.sh
+++ b/usr/share/rear/layout/save/default/335_remove_excluded_multipath_vgs.sh
@@ -19,9 +19,9 @@ while read lvmdev name mpdev junk ; do
# Remember, multipath devices from a volume group that is "excluded" should be 'commented out'
device=$(echo $mpdev | cut -c1-45)
while read LINE ; do
- # Now we need to comment all lines that contain "$devices" in the LAYOUT_FILE
+ # Now we need to comment all lines that contain "$device" in the LAYOUT_FILE
sed -i "s|^$LINE|\#$LINE|" "$LAYOUT_FILE"
- done < <(grep "$device" $LAYOUT_FILE | grep -v "^#")
+ done < <(grep " $device " $LAYOUT_FILE | grep -v "^#")
Log "Excluding multipath device $device"
done < <(grep "^#lvmdev" $LAYOUT_FILE)
@@ -31,7 +31,7 @@ done < <(grep "^#lvmdev" $LAYOUT_FILE)
while read LINE ; do
# multipath /dev/mapper/360060e8007e2e3000030e2e300002065 /dev/sdae,/dev/sdat,/dev/sdbi,/dev/sdp
device=$(echo $LINE | awk '{print $2}' | cut -c1-45)
- num=$(grep "$device" $LAYOUT_FILE | grep -v "^#" | wc -l)
+ num=$(grep " $device " $LAYOUT_FILE | grep -v "^#" | wc -l)
if [ $num -lt 2 ] ; then
# If the $device is only seen once (in a uncommented line) then the multipath is not in use
sed -i "s|^$LINE|\#$LINE|" "$LAYOUT_FILE"