From 742f4f1a58fae2a8e4fc990b6950054965a6f951 Mon Sep 17 00:00:00 2001 From: Barys Barysenka Date: Tue, 10 Mar 2026 05:30:35 -0400 Subject: [PATCH 1/3] feat(layout): exclude AUTOEXCLUDE_PATH entries from df.txt BCF-6552: [REAR] REAR tries to map the disk that has been commented in the disklayout.conf file on the source machine --- .../save/GNU/Linux/510_current_disk_usage.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/usr/share/rear/layout/save/GNU/Linux/510_current_disk_usage.sh b/usr/share/rear/layout/save/GNU/Linux/510_current_disk_usage.sh index 319f8db9e4..7470924c5f 100644 --- a/usr/share/rear/layout/save/GNU/Linux/510_current_disk_usage.sh +++ b/usr/share/rear/layout/save/GNU/Linux/510_current_disk_usage.sh @@ -24,3 +24,20 @@ else df -Pl -BM -x encfs -x tmpfs -x devtmpfs >$original_disk_space_usage_file fi +# Automatically comment out lines in original_disk_space_usage_file that match AUTOEXCLUDE_PATH +if test "$AUTOEXCLUDE_PATH" ; then + for exclude in "${AUTOEXCLUDE_PATH[@]}" ; do + while read _ _ _ _ _ mountpoint ; do + # Check if mountpoint is a subdirectory of the exclude path + # Logic matching layout/save/default/320_autoexclude.sh: + if test "${mountpoint#${exclude%/}/}" != "$mountpoint" ; then + DebugPrint "Automatically excluding $mountpoint from $original_disk_space_usage_file (belongs to $exclude in AUTOEXCLUDE_PATH)" + local mp_pattern + # Escape the mountpoint for use in the subsequent sed command + mp_pattern=$( echo "$mountpoint" | sed 's/[]\/$*.^[],]/\\&/g' ) + # Comment out the line + sed -i "\, $mp_pattern$,s/^/#/" "$original_disk_space_usage_file" + fi + done < <( grep -v -E "^Filesystem|^#" "$original_disk_space_usage_file" ) + done +fi From 4726d841ae910b39422ada46c23179fe7560676b Mon Sep 17 00:00:00 2001 From: Barys Barysenka Date: Fri, 13 Mar 2026 05:30:39 -0400 Subject: [PATCH 2/3] feat(layout): prevent failure when mapping excluded disks in df.txt BCF-6552: [REAR] REAR tries to map the disk that has been commented in the disklayout.conf file on the source machine --- .../rear/layout/prepare/default/320_apply_mappings.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr/share/rear/layout/prepare/default/320_apply_mappings.sh b/usr/share/rear/layout/prepare/default/320_apply_mappings.sh index 1a3e212813..ebb9cd774c 100644 --- a/usr/share/rear/layout/prepare/default/320_apply_mappings.sh +++ b/usr/share/rear/layout/prepare/default/320_apply_mappings.sh @@ -17,8 +17,12 @@ for file_to_migrate in "$LAYOUT_FILE" "$original_disk_space_usage_file" "$rescue if apply_layout_mappings "$file_to_migrate" ; then DebugPrint "Applied disk layout mappings to $file_to_migrate" else - LogPrintError "Failed to apply disk layout mappings to $file_to_migrate" - applied_mappings_to_all_files="no" + if [ "$file_to_migrate" = "$original_disk_space_usage_file" ] ; then + LogPrint "WARNING: Failed to apply disk layout mappings to $file_to_migrate (likely due to unmapped excluded disks)." + else + LogPrintError "Failed to apply disk layout mappings to $file_to_migrate" + applied_mappings_to_all_files="no" + fi fi done is_true $applied_mappings_to_all_files || Error "Failed to apply disk layout mappings" From 9f0e24aa5587f16554578cf4ed3084b8005323aa Mon Sep 17 00:00:00 2001 From: Barys Barysenka Date: Fri, 13 Mar 2026 06:08:58 -0400 Subject: [PATCH 3/3] feat(layout): exclude AUTOEXCLUDE_PATH entries from df.txt * fix sed regexpr BCF-6552: [REAR] REAR tries to map the disk that has been commented in the disklayout.conf file on the source machine --- usr/share/rear/layout/save/GNU/Linux/510_current_disk_usage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/share/rear/layout/save/GNU/Linux/510_current_disk_usage.sh b/usr/share/rear/layout/save/GNU/Linux/510_current_disk_usage.sh index 7470924c5f..f05b8653aa 100644 --- a/usr/share/rear/layout/save/GNU/Linux/510_current_disk_usage.sh +++ b/usr/share/rear/layout/save/GNU/Linux/510_current_disk_usage.sh @@ -34,7 +34,7 @@ if test "$AUTOEXCLUDE_PATH" ; then DebugPrint "Automatically excluding $mountpoint from $original_disk_space_usage_file (belongs to $exclude in AUTOEXCLUDE_PATH)" local mp_pattern # Escape the mountpoint for use in the subsequent sed command - mp_pattern=$( echo "$mountpoint" | sed 's/[]\/$*.^[],]/\\&/g' ) + mp_pattern=$( echo "$mountpoint" | sed 's/[][\/$*.^,]/\\&/g' ) # Comment out the line sed -i "\, $mp_pattern$,s/^/#/" "$original_disk_space_usage_file" fi