rear/SOURCES/rear-print-disk-mapping-with-sizes-RHEL-83241.patch

52 lines
3.2 KiB
Diff

diff --git a/usr/share/rear/layout/prepare/default/300_map_disks.sh b/usr/share/rear/layout/prepare/default/300_map_disks.sh
index 468aa35cf..40ba876c7 100644
--- a/usr/share/rear/layout/prepare/default/300_map_disks.sh
+++ b/usr/share/rear/layout/prepare/default/300_map_disks.sh
@@ -110,7 +110,10 @@ done
# to current block devices in the currently running recovery system:
while read keyword orig_device orig_size junk ; do
# Continue with next original device when it is already used as source in the mapping file:
- is_mapping_source "$orig_device" && continue
+ if is_mapping_source "$orig_device" ; then
+ DebugPrint "Skip automapping $orig_device with size $orig_size (already exists as source in $MAPPING_FILE)"
+ continue
+ fi
# First, try to find if there is a current disk with same name and same size as the original:
# (possibly influenced by mapping hints if known)
if has_mapping_hint "$orig_device" ; then
@@ -162,7 +165,7 @@ while read keyword orig_device orig_size junk ; do
# Ensure the determined target device is really a block device:
if test -b "$preferred_target_device_name" ; then
add_mapping "$orig_device" "$preferred_target_device_name"
- LogPrint "Using $preferred_target_device_name (same size) for recreating $orig_device"
+ LogPrint "Using $preferred_target_device_name (same size $current_size) for recreating $orig_device"
# Break looping over all current block devices to find one
# and continue with next original device in the LAYOUT_FILE:
break
@@ -213,6 +216,7 @@ while read keyword orig_device orig_size junk ; do
Log "$preferred_target_device_name excluded from device mapping choices (is already used as mapping target)"
continue
fi
+ LogPrint "The size of $preferred_target_device_name is $(blockdev --getsize64 $current_device_path)"
# Add the current device as possible choice for the user:
possible_targets+=( "$preferred_target_device_name" )
done
@@ -225,7 +229,7 @@ while read keyword orig_device orig_size junk ; do
# At the end the mapping file is shown and the user can edit it if he does not like an automated mapping:
if test "1" -eq "${#possible_targets[@]}" ; then
add_mapping "$orig_device" "$possible_targets"
- LogPrint "Using $possible_targets (the only appropriate) for recreating $orig_device"
+ LogPrint "Using $possible_targets (the only available of the disks) for recreating $orig_device with size $orig_size"
# Continue with next original device in the LAYOUT_FILE:
continue
fi
@@ -233,7 +237,7 @@ while read keyword orig_device orig_size junk ; do
skip_choice="Do not map $preferred_orig_device_name"
regular_choices=( "${possible_targets[@]}" "$skip_choice" )
rear_shell_choice="Use Relax-and-Recover shell and return back to here"
- prompt="Choose an appropriate replacement for $preferred_orig_device_name"
+ prompt="Choose an appropriate replacement for $preferred_orig_device_name with size $orig_size"
choice=""
wilful_input=""
# Generate a runtime-specific user_input_ID so that for each unmapped original device