#2721 PR merged: Improved wiping disks

Labels: enhancement, fixed / solved / done, minor bug

jsmeix opened issue at 2021-12-01 16:15:

In layout/recreate/default/120_confirm_wipedisk_disks.sh
skip disks that do not exist on the bare hardware in the recovery system
cf. https://github.com/rear/rear/issues/2715
and exclude disks that are write-protected and
cf. https://github.com/rear/rear/pull/2703#issuecomment-979928423
show what disks will be wiped in any case to the user.
In layout/recreate/default/150_wipe_disks.sh do no longer
open (and close) LUKS volumes because encrypted volumes
contain meaningless data unless opened and unencrypted so there is no need
to wipe anything inside an encrypted LUKS container, cf. "Regarding LUKS"
in https://github.com/rear/rear/pull/2514#issuecomment-743483945

jsmeix commented at 2021-12-01 16:23:

Excerpts from my "rear mkbackup" / "rear recover" test
with the same two VMs as in https://github.com/rear/rear/pull/2714

# grep -v '^#' etc/rear/local.conf 
OUTPUT=ISO
BACKUP=NETFS
BACKUP_OPTIONS="nfsvers=3,nolock"
BACKUP_URL=nfs://192.168.122.1/nfs
REQUIRED_PROGS+=( snapper chattr )
PROGS+=( lsattr )
COPY_AS_IS+=( /usr/lib/snapper/installation-helper /etc/snapper/config-templates/default )
BACKUP_PROG_INCLUDE=( /boot/grub2/x86_64-efi /home /boot/grub2/i386-pc /root /srv /opt /tmp /usr/local /var )
POST_RECOVERY_SCRIPT=( 'if snapper --no-dbus -r $TARGET_FS_ROOT get-config | grep -q "^QGROUP.*[0-9]/[0-9]" ; then snapper --no-dbus -r $TARGET_FS_ROOT set-config QGROUP= ; snapper --no-dbus -r $TARGET_FS_ROOT setup-quota && echo snapper setup-quota done || echo snapper setup-quota failed ; else echo snapper setup-quota not used ; fi' )
SSH_ROOT_PASSWORD='rear'
USE_DHCLIENT="yes"
FIRMWARE_FILES=( 'no' )
MODULES=( 'loaded_modules' )
PROGRESS_MODE="plain"
PROGRESS_WAIT_SECONDS="3"
DISKS_TO_BE_WIPED=''
LUKS_CRYPTSETUP_OPTIONS+=" --force-password"
GRUB2_INSTALL_DEVICES="/dev/sda /dev/sdb"
DISKS_TO_BE_WIPED="/dev/sd[a-z]"

# rear -D recover
...
Determining disks to be wiped ...
UserInput -I WIPE_DISKS_CONFIRMATION needed in /usr/share/rear/layout/recreate/default/120_confirm_wipedisk_disks.sh line 84
Disks to be wiped: /dev/sda /dev/sdb /dev/sdc 
1) Confirm disks to be completely overwritten and continue 'rear recover'
2) Use Relax-and-Recover shell and return back to here
3) Abort 'rear recover'
(default '1' timeout 300 seconds)
UserInput: Will use predefined input in USER_INPUT_WIPE_DISKS_CONFIRMATION='Confirm disks to be completely overwritten and continue 'rear recover''
Hit any key to interrupt the automated input (timeout 5 seconds)
UserInput: Result is 'Confirm disks to be completely overwritten and continue 'rear recover''
User confirmed disks to be wiped
Wiping child devices of /dev/sda in reverse ordering: /dev/sda2 /dev/sda1 /dev/sda 
Wiped first 16777216 bytes of /dev/sda2
Wiped last 16777216 bytes of /dev/sda2
Wiped first 10485760 bytes of /dev/sda1
Skip wiping at the end of /dev/sda1 (dvice size 10485760 not greater than the bytes that were wiped)
Wiped first 16777216 bytes of /dev/sda
Wiped last 16777216 bytes of /dev/sda
Wiping child devices of /dev/sdb in reverse ordering: /dev/sdb2 /dev/sdb1 /dev/sdb 
Wiped first 16777216 bytes of /dev/sdb2
Wiped last 16777216 bytes of /dev/sdb2
Wiped first 10485760 bytes of /dev/sdb1
Skip wiping at the end of /dev/sdb1 (dvice size 10485760 not greater than the bytes that were wiped)
Wiped first 16777216 bytes of /dev/sdb
Wiped last 16777216 bytes of /dev/sdb
Wiping child devices of /dev/sdc in reverse ordering: /dev/sdc1 /dev/sdc 
Wiped first 16777216 bytes of /dev/sdc1
Wiped last 16777216 bytes of /dev/sdc1
Wiped first 16777216 bytes of /dev/sdc
Wiped last 16777216 bytes of /dev/sdc
Start system layout restoration.
Disk '/dev/sdc': creating 'gpt' partition table
Disk '/dev/sdc': creating partition number 1 with name ''sdc1''
Creating software RAID /dev/md127
Disk '/dev/md127': creating 'gpt' partition table
Disk '/dev/md127': creating partition number 1 with name ''md127p1''
Disk '/dev/md127': creating partition number 2 with name ''md127p2''
Creating swap on /dev/sdc1
Creating LUKS volume cr_root on /dev/md127p2
Set the password for LUKS volume cr_root (for 'cryptsetup luksFormat' on /dev/md127p2):
Enter passphrase for /dev/md127p2: 
Enter the password for LUKS volume cr_root (for 'cryptsetup luksOpen' on /dev/md127p2):
Enter passphrase for /dev/md127p2: 
Creating filesystem of type btrfs with mount point / on /dev/mapper/cr_root.
Mounting filesystem /
Disk layout created.

jsmeix commented at 2021-12-02 16:45:

With the latest changes:

Original system:

# lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT
NAME                      KNAME        PKNAME       TRAN TYPE  FSTYPE             SIZE MOUNTPOINT
/dev/sda                  /dev/sda                  ata  disk  linux_raid_member   12G 
`-/dev/md127              /dev/md127   /dev/sda          raid1                     12G 
  |-/dev/md127p1          /dev/md127p1 /dev/md127        part                      10M 
  `-/dev/md127p2          /dev/md127p2 /dev/md127        part  crypto_LUKS       11.9G 
    `-/dev/mapper/cr_root /dev/dm-0    /dev/md127p2      crypt btrfs             11.9G /
/dev/sdb                  /dev/sdb                  ata  disk  linux_raid_member   12G 
`-/dev/md127              /dev/md127   /dev/sdb          raid1                     12G 
  |-/dev/md127p1          /dev/md127p1 /dev/md127        part                      10M 
  `-/dev/md127p2          /dev/md127p2 /dev/md127        part  crypto_LUKS       11.9G 
    `-/dev/mapper/cr_root /dev/dm-0    /dev/md127p2      crypt btrfs             11.9G /
/dev/sdc                  /dev/sdc                  ata  disk                       1G 
`-/dev/sdc1               /dev/sdc1    /dev/sdc          part  swap              1023M [SWAP]

# grep -v '^#' etc/rear/local.conf 
OUTPUT=ISO
BACKUP=NETFS
BACKUP_OPTIONS="nfsvers=3,nolock"
BACKUP_URL=nfs://192.168.122.1/nfs
REQUIRED_PROGS+=( snapper chattr )
PROGS+=( lsattr )
COPY_AS_IS+=( /usr/lib/snapper/installation-helper /etc/snapper/config-templates/default )
BACKUP_PROG_INCLUDE=( /boot/grub2/x86_64-efi /home /boot/grub2/i386-pc /root /srv /opt /tmp /usr/local /var )
POST_RECOVERY_SCRIPT=( 'if snapper --no-dbus -r $TARGET_FS_ROOT get-config | grep -q "^QGROUP.*[0-9]/[0-9]" ; then snapper --no-dbus -r $TARGET_FS_ROOT set-config QGROUP= ; snapper --no-dbus -r $TARGET_FS_ROOT setup-quota && echo snapper setup-quota done || echo snapper setup-quota failed ; else echo snapper setup-quota not used ; fi' )
SSH_ROOT_PASSWORD='rear'
USE_DHCLIENT="yes"
FIRMWARE_FILES=( 'no' )
MODULES=( 'loaded_modules' )
PROGRESS_MODE="plain"
PROGRESS_WAIT_SECONDS="3"
DISKS_TO_BE_WIPED=''
LUKS_CRYPTSETUP_OPTIONS+=" --force-password"
GRUB2_INSTALL_DEVICES="/dev/sda /dev/sdb"

Replacement system:

RESCUE localhost:~ # lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT
NAME        KNAME     PKNAME   TRAN TYPE FSTYPE             SIZE MOUNTPOINT
/dev/sda    /dev/sda           ata  disk linux_raid_member   12G 
|-/dev/sda1 /dev/sda1 /dev/sda      part linux_raid_member   10M 
`-/dev/sda2 /dev/sda2 /dev/sda      part crypto_LUKS       11.9G 
/dev/sdb    /dev/sdb           ata  disk linux_raid_member   12G 
|-/dev/sdb1 /dev/sdb1 /dev/sdb      part linux_raid_member   10M 
`-/dev/sdb2 /dev/sdb2 /dev/sdb      part crypto_LUKS       11.9G 
/dev/sdc    /dev/sdc           ata  disk                      1G 
`-/dev/sdc1 /dev/sdc1 /dev/sdc      part swap              1023M


RESCUE localhost:~ # rear -D recover
...
Determining disks to be wiped ...
Disks to be completely overwritten: /dev/md127 /dev/sdc 
RAID device /dev/md127 does not exist - trying to determine its parent disks
/dev/sda is a parent disk of /dev/md127 that should be wiped
Adding parent /dev/sda to be wiped (/dev/sda is not write-protected)
/dev/sdb is a parent disk of /dev/md127 that should be wiped
Adding parent /dev/sdb to be wiped (/dev/sdb is not write-protected)
UserInput -I WIPE_DISKS_CONFIRMATION needed in /usr/share/rear/layout/recreate/default/120_confirm_wipedisk_disks.sh line 144
Disks to be wiped: /dev/sda /dev/sdb /dev/sdc 
1) Confirm disks to be completely overwritten and continue 'rear recover'
2) Use Relax-and-Recover shell and return back to here
3) Abort 'rear recover'
(default '1' timeout 300 seconds)
UserInput: Will use predefined input in USER_INPUT_WIPE_DISKS_CONFIRMATION='Confirm disks to be completely overwritten and continue 'rear recover''
Hit any key to interrupt the automated input (timeout 10 seconds)
UserInput: Result is 'Confirm disks to be completely overwritten and continue 'rear recover''
User confirmed disks to be wiped
Wiping child devices of /dev/sda in reverse ordering: /dev/sda2 /dev/sda1 /dev/sda 
Wiped first 16777216 bytes of /dev/sda2
Wiped last 16777216 bytes of /dev/sda2
Wiped first 10485760 bytes of /dev/sda1
Skip wiping at the end of /dev/sda1 (dvice size 10485760 not greater than the bytes that were wiped)
Wiped first 16777216 bytes of /dev/sda
Wiped last 16777216 bytes of /dev/sda
Wiping child devices of /dev/sdb in reverse ordering: /dev/sdb2 /dev/sdb1 /dev/sdb 
Wiped first 16777216 bytes of /dev/sdb2
Wiped last 16777216 bytes of /dev/sdb2
Wiped first 10485760 bytes of /dev/sdb1
Skip wiping at the end of /dev/sdb1 (dvice size 10485760 not greater than the bytes that were wiped)
Wiped first 16777216 bytes of /dev/sdb
Wiped last 16777216 bytes of /dev/sdb
Wiping child devices of /dev/sdc in reverse ordering: /dev/sdc1 /dev/sdc 
Wiped first 16777216 bytes of /dev/sdc1
Wiped last 16777216 bytes of /dev/sdc1
Wiped first 16777216 bytes of /dev/sdc
Wiped last 16777216 bytes of /dev/sdc
Start system layout restoration.
Disk '/dev/sdc': creating 'gpt' partition table
Disk '/dev/sdc': creating partition number 1 with name ''sdc1''
Creating software RAID /dev/md127
Disk '/dev/md127': creating 'gpt' partition table
Disk '/dev/md127': creating partition number 1 with name ''md127p1''
Disk '/dev/md127': creating partition number 2 with name ''md127p2''
Creating swap on /dev/sdc1
Creating LUKS volume cr_root on /dev/md127p2
Set the password for LUKS volume cr_root (for 'cryptsetup luksFormat' on /dev/md127p2):
Enter passphrase for /dev/md127p2: 
Enter the password for LUKS volume cr_root (for 'cryptsetup luksOpen' on /dev/md127p2):
Enter passphrase for /dev/md127p2: 
Creating filesystem of type btrfs with mount point / on /dev/mapper/cr_root.
Mounting filesystem /
Disk layout created.
...

RESCUE localhost:~ # lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT
NAME                      KNAME        PKNAME       TRAN TYPE  FSTYPE             SIZE MOUNTPOINT
/dev/sda                  /dev/sda                  ata  disk  linux_raid_member   12G 
|-/dev/sda1               /dev/sda1    /dev/sda          part  linux_raid_member   10M 
|-/dev/sda2               /dev/sda2    /dev/sda          part  crypto_LUKS       11.9G 
`-/dev/md127              /dev/md127   /dev/sda          raid1                     12G 
  |-/dev/md127p1          /dev/md127p1 /dev/md127        part                      10M 
  `-/dev/md127p2          /dev/md127p2 /dev/md127        part  crypto_LUKS       11.9G 
    `-/dev/mapper/cr_root /dev/dm-0    /dev/md127p2      crypt btrfs             11.9G /mnt/local
/dev/sdb                  /dev/sdb                  ata  disk  linux_raid_member   12G 
|-/dev/sdb1               /dev/sdb1    /dev/sdb          part  linux_raid_member   10M 
|-/dev/sdb2               /dev/sdb2    /dev/sdb          part  crypto_LUKS       11.9G 
`-/dev/md127              /dev/md127   /dev/sdb          raid1                     12G 
  |-/dev/md127p1          /dev/md127p1 /dev/md127        part                      10M 
  `-/dev/md127p2          /dev/md127p2 /dev/md127        part  crypto_LUKS       11.9G 
    `-/dev/mapper/cr_root /dev/dm-0    /dev/md127p2      crypt btrfs             11.9G /mnt/local
/dev/sdc                  /dev/sdc                  ata  disk                       1G 
`-/dev/sdc1               /dev/sdc1    /dev/sdc          part  swap              1023M

jsmeix commented at 2021-12-03 13:47:

Did another test with same VMs but now I have in the booted recovery system

RESCUE localhost:~ # lsblk -ipo NAME,KNAME,PKNAME,TYPE,FSTYPE
NAME        KNAME     PKNAME   TYPE FSTYPE
/dev/sda    /dev/sda           disk linux_raid_member
/dev/sdb    /dev/sdb           disk linux_raid_member
/dev/sdc    /dev/sdc           disk 
`-/dev/sdc1 /dev/sdc1 /dev/sdc part

so no PKNAME for the RAID1 disks /dev/sda and /dev/sdb
which lets wiping that RAID disks fail

# rear -D recover
...
Determining disks to be wiped ...
Disks to be completely overwritten: /dev/md127 /dev/sdc 
RAID device /dev/md127 does not exist - trying to determine its parent disks
Skipping RAID device /dev/md127 to be wiped (no parent disk found for it)
UserInput -I WIPE_DISKS_CONFIRMATION needed in /usr/share/rear/layout/recreate/default/120_confirm_wipedisk_disks.sh line 143
Disks to be wiped: /dev/sdc

jsmeix commented at 2021-12-03 13:57:

With latest change I get

# rear -D recover
...
Determining disks to be wiped ...
Disks to be completely overwritten: /dev/md127 /dev/sdc 
RAID device /dev/md127 does not exist - trying to determine its parent disks
/dev/sda is a parent disk of /dev/md127 that should be wiped
Adding parent /dev/sda to be wiped (/dev/sda is not write-protected)
/dev/sdb is a parent disk of /dev/md127 that should be wiped
Adding parent /dev/sdb to be wiped (/dev/sdb is not write-protected)
UserInput -I WIPE_DISKS_CONFIRMATION needed in /usr/share/rear/layout/recreate/default/120_confirm_wipedisk_disks.sh line 154
Disks to be wiped: /dev/sda /dev/sdb /dev/sdc 
1) Confirm disks to be completely overwritten and continue 'rear recover'
2) Use Relax-and-Recover shell and return back to here
3) Abort 'rear recover'
(default '1' timeout 10 seconds)
UserInput: No real user input (empty or only spaces) - using default input
UserInput: Valid choice number result 'Confirm disks to be completely overwritten and continue 'rear recover''
Continuing 'rear recover' by default
Wiping child devices of /dev/sda in reverse ordering: /dev/sda 
Wiped first 16777216 bytes of /dev/sda
Wiped last 16777216 bytes of /dev/sda
Wiping child devices of /dev/sdb in reverse ordering: /dev/sdb 
Wiped first 16777216 bytes of /dev/sdb
Wiped last 16777216 bytes of /dev/sdb
Wiping child devices of /dev/sdc in reverse ordering: /dev/sdc1 /dev/sdc 
Wiped first 16777216 bytes of /dev/sdc1
Wiped last 16777216 bytes of /dev/sdc1
Wiped first 16777216 bytes of /dev/sdc
Wiped last 16777216 bytes of /dev/sdc
Start system layout restoration.

jsmeix commented at 2021-12-03 14:35:

Now wiping RAID array devices works automatically for me
at least for my RAID1 array that I tested here.

@rear/contributors
because by default DISKS_TO_BE_WIPED='false'
the changes here do not affect how ReaR behaves by default
so I would like to merge it next Monday afternoon
if there are no objections.

jsmeix commented at 2021-12-07 13:30:

Tested with OUTPUT=USB:

Two VMs (original and replacement system) with

/dev/sda 12GiB RAID1 array member
/dev/sdb 5 GiB ReaR "USB" disk
/dev/sdc 12GiB RAID1 array member
/dev/sdd 1GiB swap

My etc/rear/local.conf

OUTPUT=USB
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
REQUIRED_PROGS+=( snapper chattr )
PROGS+=( lsattr )
COPY_AS_IS+=( /usr/lib/snapper/installation-helper /etc/snapper/config-templates/default )
BACKUP_PROG_INCLUDE=( /boot/grub2/x86_64-efi /home /boot/grub2/i386-pc /root /srv /opt /tmp /usr/local /var )
POST_RECOVERY_SCRIPT=( 'if snapper --no-dbus -r $TARGET_FS_ROOT get-config | grep -q "^QGROUP.*[0-9]/[0-9]" ; then snapper --no-dbus -r $TARGET_FS_ROOT set-config QGROUP= ; snapper --no-dbus -r $TARGET_FS_ROOT setup-quota && echo snapper setup-quota done || echo snapper setup-quota failed ; else echo snapper setup-quota not used ; fi' )
SSH_ROOT_PASSWORD='rear'
USE_DHCLIENT="yes"
FIRMWARE_FILES=( 'no' )
MODULES=( 'loaded_modules' )
PROGRESS_MODE="plain"
PROGRESS_WAIT_SECONDS="3"
LUKS_CRYPTSETUP_OPTIONS+=" --force-password"
GRUB2_INSTALL_DEVICES="/dev/sda /dev/sdc"
DISKS_TO_BE_WIPED=''

I did usr/sbin/rear -D format /dev/sdb

# lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,LABEL,SIZE,MOUNTPOINT
NAME                      KNAME        PKNAME       TRAN TYPE  FSTYPE            LABEL          SIZE MOUNTPOINT
/dev/sda                  /dev/sda                  ata  disk  linux_raid_member any:raid1sdab   12G 
`-/dev/md127              /dev/md127   /dev/sda          raid1                                   12G 
  |-/dev/md127p1          /dev/md127p1 /dev/md127        part                                    10M 
  `-/dev/md127p2          /dev/md127p2 /dev/md127        part  crypto_LUKS                     11.9G 
    `-/dev/mapper/cr_root /dev/dm-0    /dev/md127p2      crypt btrfs                           11.9G /
/dev/sdb                  /dev/sdb                  ata  disk                                     5G 
|-/dev/sdb1               /dev/sdb1    /dev/sdb          part                                     8M 
|-/dev/sdb2               /dev/sdb2    /dev/sdb          part  vfat              REAR-EFI       512M 
|-/dev/sdb3               /dev/sdb3    /dev/sdb          part  ext2              MY-BOOT          1G 
`-/dev/sdb4               /dev/sdb4    /dev/sdb          part  ext3              MY-DATA        3.5G 
/dev/sdc                  /dev/sdc                  ata  disk  linux_raid_member any:raid1sdab   12G 
`-/dev/md127              /dev/md127   /dev/sdc          raid1                                   12G 
  |-/dev/md127p1          /dev/md127p1 /dev/md127        part                                    10M 
  `-/dev/md127p2          /dev/md127p2 /dev/md127        part  crypto_LUKS                     11.9G 
    `-/dev/mapper/cr_root /dev/dm-0    /dev/md127p2      crypt btrfs                           11.9G /
/dev/sdd                  /dev/sdd                  ata  disk                                     1G 
`-/dev/sdd1               /dev/sdd1    /dev/sdd          part  swap                            1023M [SWAP]

"rear mkbackup" excerpts:

# usr/sbin/rear -D mkbackup
...
USB disk IDs of '/dev/disk/by-label/MY-DATA' added to WRITE_PROTECTED_IDS
File system label of '/dev/disk/by-label/MY-DATA' added to WRITE_PROTECTED_FS_LABEL_PATTERNS
...
Automatically excluding disk /dev/sdb (not used by any mounted filesystem)
Marking component '/dev/sdb' as done in /root/rear.github.master.wipedisk/var/lib/rear/layout/disktodo.conf
Dependant component /dev/sdb1 is a child of component /dev/sdb
Marking component '/dev/sdb1' as done in /root/rear.github.master.wipedisk/var/lib/rear/layout/disktodo.conf
Dependant component /dev/sdb2 is a child of component /dev/sdb
Marking component '/dev/sdb2' as done in /root/rear.github.master.wipedisk/var/lib/rear/layout/disktodo.conf
Dependant component /dev/sdb3 is a child of component /dev/sdb
Marking component '/dev/sdb3' as done in /root/rear.github.master.wipedisk/var/lib/rear/layout/disktodo.conf
Dependant component /dev/sdb4 is a child of component /dev/sdb
Marking component '/dev/sdb4' as done in /root/rear.github.master.wipedisk/var/lib/rear/layout/disktodo.conf
Disabling excluded components in /root/rear.github.master.wipedisk/var/lib/rear/layout/disklayout.conf
Disabling component 'disk /dev/sdb' in /root/rear.github.master.wipedisk/var/lib/rear/layout/disklayout.conf
Disabling component 'part /dev/sdb' in /root/rear.github.master.wipedisk/var/lib/rear/layout/disklayout.conf
Component 'part /dev/sdb' is disabled in /root/rear.github.master.wipedisk/var/lib/rear/layout/disklayout.conf
Component 'part /dev/sdb' is disabled in /root/rear.github.master.wipedisk/var/lib/rear/layout/disklayout.conf
Component 'part /dev/sdb' is disabled in /root/rear.github.master.wipedisk/var/lib/rear/layout/disklayout.conf

"rear recover" excerpts:

RESCUE localhost:~ # rear -D recover
...
Ambiguous disk layout needs manual configuration (more than one disk with same size used in '/var/lib/rear/layout/disklayout.conf')
Switching to manual disk layout configuration
Using /dev/sda (same name and same size 12884901888) for recreating /dev/sda
Using /dev/sdc (same name and same size 12884901888) for recreating /dev/sdc
Using /dev/sdd (same name and same size 1073741824) for recreating /dev/sdd
Current disk mapping table (source => target):
  /dev/sda => /dev/sda
  /dev/sdc => /dev/sdc
  /dev/sdd => /dev/sdd

UserInput -I LAYOUT_MIGRATION_CONFIRM_MAPPINGS needed in /usr/share/rear/layout/prepare/default/300_map_disks.sh line 315
Confirm or edit the disk mapping
1) Confirm disk mapping and continue 'rear recover'
2) Confirm identical disk mapping and proceed without manual configuration
3) Edit disk mapping (/var/lib/rear/layout/disk_mappings)
4) Use Relax-and-Recover shell and return back to here
5) Abort 'rear recover'
(default '1' timeout 300 seconds)
2
...
Determining disks to be wiped ...
Disks to be completely overwritten: /dev/md127 /dev/sdd 
RAID device /dev/md127 does not exist - trying to determine its parent disks
/dev/sda is a parent disk of /dev/md127 that should be wiped
Adding parent /dev/sda to be wiped (/dev/sda is not write-protected)
/dev/sdc is a parent disk of /dev/md127 that should be wiped
Adding parent /dev/sdc to be wiped (/dev/sdc is not write-protected)
UserInput -I WIPE_DISKS_CONFIRMATION needed in /usr/share/rear/layout/recreate/default/120_confirm_wipedisk_disks.sh line 154
Disks to be wiped: /dev/sda /dev/sdc /dev/sdd 
1) Confirm disks to be completely overwritten and continue 'rear recover'
2) Use Relax-and-Recover shell and return back to here
3) Abort 'rear recover'
(default '1' timeout 10 seconds)
UserInput: No real user input (empty or only spaces) - using default input
UserInput: Valid choice number result 'Confirm disks to be completely overwritten and continue 'rear recover''
Continuing 'rear recover' by default
Wiping child devices of /dev/sda in reverse ordering: /dev/sda2 /dev/sda1 /dev/sda 
Wiped first 16777216 bytes of /dev/sda2
Wiped last 16777216 bytes of /dev/sda2
Wiped first 10485760 bytes of /dev/sda1
Skip wiping at the end of /dev/sda1 (dvice size 10485760 not greater than the bytes that were wiped)
Wiped first 16777216 bytes of /dev/sda
Wiped last 16777216 bytes of /dev/sda
Wiping child devices of /dev/sdc in reverse ordering: /dev/sdc2 /dev/sdc1 /dev/sdc 
Wiped first 16777216 bytes of /dev/sdc2
Wiped last 16777216 bytes of /dev/sdc2
Wiped first 10485760 bytes of /dev/sdc1
Skip wiping at the end of /dev/sdc1 (dvice size 10485760 not greater than the bytes that were wiped)
Wiped first 16777216 bytes of /dev/sdc
Wiped last 16777216 bytes of /dev/sdc
Wiping child devices of /dev/sdd in reverse ordering: /dev/sdd1 /dev/sdd 
Wiped first 16777216 bytes of /dev/sdd1
Wiped last 16777216 bytes of /dev/sdd1
Wiped first 16777216 bytes of /dev/sdd
Wiped last 16777216 bytes of /dev/sdd
Start system layout restoration.

The recreated system works well for me.

jsmeix commented at 2021-12-07 13:58:

Same as above in
https://github.com/rear/rear/pull/2721#issuecomment-987927716
but now in etc/rear/local.conf

DISKS_TO_BE_WIPED="/dev/sd[a-z]"

results this "rear recover" excerpts

Determining disks to be wiped ...
Excluding /dev/sdb from DISKS_TO_BE_WIPED (/dev/sdb is write-protected)
UserInput -I WIPE_DISKS_CONFIRMATION needed in /usr/share/rear/layout/recreate/default/120_confirm_wipedisk_disks.sh line 154
Disks to be wiped: /dev/sda /dev/sdc /dev/sdd

so also all OK.


[Export of Github issue for rear/rear.]