#2708 PR merged
: New function is_multipath_used in layout-functions.sh¶
Labels: enhancement
, fixed / solved / done
jsmeix opened issue at 2021-11-11 11:48:¶
-
Type: Enhancement
-
Impact: High
Basically no impact on systems with a few disks.
Medium impact on systems with many disks (hundreds).
High impact on systems with very many disks (thousands). -
Reference to related issue (URL):
https://github.com/rear/rear/pull/2597
https://github.com/rear/rear/pull/2299/files#r709909416 -
How was this pull request tested?
I can only test on non-multipath systems with a few disks,
see https://github.com/rear/rear/pull/2708#issuecomment-967073823
and https://github.com/rear/rear/pull/2708#issuecomment-967108185 -
Brief description of the changes in this pull request:
Get 'multipath -l' out of the function is_multipath_path
by adding a separated function is_multipath_used
that runs 'multipath -l' (which is expensive because it scans all devices)
to check if multipath is used and remembers the result in MULTIPATH_IS_USED
that is used in subsequent calls of is_multipath_used (without calling 'multipath -l')
so we can call is_multipath_used many times in is_multipath_path
The next ReaR version 2.7 should not be released
without a fix for the root cause behind
https://github.com/rear/rear/pull/2597
jsmeix commented at 2021-11-12 12:27:¶
Testing with same VMs as in
https://github.com/rear/rear/pull/2703#issuecomment-952888484
original system replacement system
sda 8 GiB system disk sda the 8 GiB ReaR "USB" disk from the original system
sdb 8 GiB ReaR "USB" disk sdb 9 GiB replacement system disk
# grep -v '^#' etc/rear/local.conf
DISKS_TO_BE_WIPED=''
FIRMWARE_FILES=( 'no' )
MODULES=( 'loaded_modules' )
PROGRESS_MODE="plain"
PROGRESS_WAIT_SECONDS="3"
SSH_ROOT_PASSWORD="rear"
OUTPUT=USB
USB_DEVICE_FILESYSTEM_PERCENTAGE=90
USB_DEVICE_FILESYSTEM_LABEL="MY-DATA"
USB_BOOT_PART_SIZE=1024
USB_BOOTLOADER="grub"
USB_DEVICE_BOOT_LABEL="MY-BOOT"
OUTPUT_URL=usb:///dev/disk/by-label/MY-BOOT
USB_DEVICE_PARTED_LABEL=gpt
BACKUP=NETFS
BACKUP_URL=usb:///dev/disk/by-label/MY-DATA
"rear -D mkrescue" results same var/lib/rear/layout/disklayout.conf
as in
https://github.com/rear/rear/pull/2703
and the log shows about is_multipath_* functions (excerpts)
++ is_multipath_path sda
++ test sda
++ is_multipath_used
++ type multipath
++ is_true
++ case "$1" in
++ return 1
++ is_false
++ case "$1" in
++ return 1
++ grep -q '[[:alnum:]]'
++ multipath -l
++ MULTIPATH_IS_USED=no
++ return 1
++ return 1
...
++ is_multipath_path sdb
++ test sdb
++ is_multipath_used
++ type multipath
++ is_true no
++ case "$1" in
++ return 1
++ is_false no
++ case "$1" in
++ return 0
++ return 1
++ return 1
so to me all looks as expected.
jsmeix commented at 2021-11-12 13:11:¶
"rear -D recover" just works for me as in #2703
and the log shows about is_multipath_* functions (excerpts)
++ is_multipath_path sda
++ test sda
++ is_multipath_used
++ type multipath
++ return 1
++ return 1
...
++ is_multipath_path sdb
++ test sdb
++ is_multipath_used
++ type multipath
++ return 1
++ return 1
because there is no 'multipath' program in the recovery system
so to me all looks as expected.
jsmeix commented at 2021-11-12 13:16:¶
@pcahyna @rmetrich @rear/contributors
if there are no objections I would like to merge it next Monday
afternoon.
@pcahyna
if you know a better method than multipath -l
which we should use in the new function is_multipath_used
it can be done as separated further enhancement/optimization
at any later time as you wish, cf.
https://github.com/rear/rear/pull/2299/files#r709942204
pcahyna commented at 2021-11-12 13:24:¶
@jsmeix sure, since our last discussion about multipath I have learned a bit about it and managed to automate test machine deployments, so I will gladly propose improvements if applicable, and do any tests that are needed.
[Export of Github issue for rear/rear.]