Skip to content

Test Matrix ReaR 2.7

Johannes Meixner edited this page Oct 7, 2022 · 25 revisions

Test Matrix ReaR 2.7

We will fill up this page with tests we have done (and we accept input and feedback from the ReaR community).

Arch x86

Ubuntu

SLES

SLES11 SP4 with LVM that is LUKS encrypted

# lsblk -o NAME,KNAME,FSTYPE,SIZE,MOUNTPOINT
NAME                     KNAME FSTYPE       SIZE MOUNTPOINT
sda                      sda                 15G
├─sda1                   sda1  ext3         156M /boot
└─sda2                   sda2  crypto_LUKS 14.9G
  └─cr_sda2 (dm-0)       dm-0  LVM2_member 14.9G
    ├─system-root (dm-1) dm-1  ext3          10G /
    └─system-swap (dm-2) dm-2  swap           2G [SWAP]

Because cryptsetup 1.1.3 in SLES11 SP4 does not support 'uuid' and 'type' options manual adaptions in disklayout.conf were needed before "rear recover" was called (i.e. removal of the 'type=...' and 'uuid=...' options of the 'crypt' entry in disklayout.conf) and also LUKS_CRYPTSETUP_OPTIONS="--iter-time 200" in etc/rear/local.conf (i.e. removal of the '--use-random' default option that is not supported on SLES11) was needed for LUKS recovery (cf. https://github.com/rear/rear/pull/2827#issuecomment-1163210490). Furthermore wiping disks during "rear recover" before recreating the disk layout via DISKS_TO_BE_WIPED cannot work in SLES11 SP4 because 'lsblk' in SLES11 SP4 does not support the needed options (e.g. 'lsblk -nlpo KNAME /dev/sda' fails because '-p' is not supported).

SLES15 SP3 with LVM that is LUKS encrypted with btrfs root LV and xfs home LV

# lsblk -ipo NAME,KNAME,TYPE,FSTYPE,SIZE,MOUNTPOINT
NAME                                               KNAME     TYPE  FSTYPE     SIZE MOUNTPOINT
/dev/sda                                           /dev/sda  disk              15G
|-/dev/sda1                                        /dev/sda1 part               8M
`-/dev/sda2                                        /dev/sda2 part  crypto_LUKS 15G
  `-/dev/mapper/cr_ata-QEMU_HARDDISK_QM00001-part2 /dev/dm-0 crypt LVM2_member 15G
    |-/dev/mapper/system-rootLV                    /dev/dm-1 lvm   btrfs       12G /
    |-/dev/mapper/system-swapLV                    /dev/dm-2 lvm   swap         1G [SWAP]
    `-/dev/mapper/system-homeLV                    /dev/dm-3 lvm   xfs          1G /home

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 /boot/grub2/i386-pc /opt /root /srv /usr/local /tmp /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' )

Cf. https://github.com/rear/rear/pull/2827#issuecomment-1164428971

SLES15 SP4 with RAID1 migrated to replacement systems with smaller and bigger disk size

Original system with 9 GB sda and 10 GB sdb

# parted -s /dev/sda unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 9.00GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system     Name  Flags
 1      0.00GiB  0.10GiB  0.10GiB                        bios_grub
 2      0.10GiB  1.10GiB  1.00GiB  linux-swap(v1)        swap
 3      1.10GiB  8.60GiB  7.50GiB  btrfs

# parted -s /dev/sdb unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdb: 10.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system     Name  Flags
 1      0.00GiB  0.10GiB  0.10GiB                        bios_grub
 2      0.10GiB  1.10GiB  1.00GiB  linux-swap(v1)        swap
 3      1.10GiB  8.60GiB  7.50GiB  btrfs

# lsblk -ipo NAME,TYPE,FSTYPE,SIZE
NAME             TYPE  FSTYPE             SIZE
/dev/sda         disk  linux_raid_member    9G
`-/dev/md127     raid1                      9G
  |-/dev/md127p1 part                     102M
  |-/dev/md127p2 part  swap                 1G
  `-/dev/md127p3 part  btrfs              7.5G
/dev/sdb         disk  linux_raid_member   10G
`-/dev/md127     raid1                      9G
  |-/dev/md127p1 part                     102M
  |-/dev/md127p2 part  swap                 1G
  `-/dev/md127p3 part  btrfs              7.5G

# findmnt -a -t btrfs -o TARGET,SOURCE
TARGET                   SOURCE
/                        /dev/md127p3[/@]
|-/home                  /dev/md127p3[/@/home]
|-/opt                   /dev/md127p3[/@/opt]
|-/boot/grub2/x86_64-efi /dev/md127p3[/@/boot/grub2/x86_64-efi]
|-/srv                   /dev/md127p3[/@/srv]
|-/boot/grub2/i386-pc    /dev/md127p3[/@/boot/grub2/i386-pc]
|-/root                  /dev/md127p3[/@/root]
|-/usr/local             /dev/md127p3[/@/usr/local]
|-/tmp                   /dev/md127p3[/@/tmp]
`-/var                   /dev/md127p3[/@/var]

# 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 /boot/grub2/i386-pc /home /opt /root /tmp /srv /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"
DISKS_TO_BE_WIPED=''
GRUB2_INSTALL_DEVICES="/dev/sda /dev/sdb"
AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE=20
AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE=10

Migration to replacement system with smaller 8 GB sda and same size 10 GB sdb

During "rear recover" (all migration mode user confirmation dialogs were accepted unaltered):

RESCUE localhost:~ # rear -D recover
...
Comparing disks
Device sda has size 8589934592 bytes but 9663676416 bytes is expected (needs manual configuration)
Device sdb has expected (same) size 10737418240 bytes (will be used for 'recover')
Switching to manual disk layout configuration (GiB sizes rounded down to integer)
/dev/sda had size 9663676416 (9 GiB) but is now 8589934592 (8 GiB)
/dev/sdb has same size 10737418240 (10 GiB)
Could not automap /dev/sda (no disk with same size 9663676416 found)
Using /dev/sdb (same name and same size 10737418240) for recreating /dev/sdb
Original disk /dev/sda does not exist (with same size) in the target system
Using /dev/sda (the only available of the disks) for recreating /dev/sda
Current disk mapping table (source => target):
  /dev/sdb => /dev/sdb
  /dev/sda => /dev/sda
...
Trying to automatically resize last partition when disk size changed
Examining gpt device /dev/md127 to automatically resize its last active partition
New /dev/md127 is 1073741824 bytes smaller than old device
Checking /dev/md127p1 if it is the last partition on /dev/md127
Checking /dev/md127p2 if it is the last partition on /dev/md127
Checking /dev/md127p3 if it is the last partition on /dev/md127
Found 'rear-noname' partition /dev/md127p3 as last partition on /dev/md127
Determining if last partition /dev/md127p3 is resizeable
Determining new size for last partition /dev/md127p3
Determining if last partition /dev/md127p3 actually needs to be increased or shrinked
Last partition /dev/md127p3 must be shrinked by 645922816 bytes to still fit on device
Shrinking last partition /dev/md127p3 to end of device (new device at most 20% smaller)
Changed last partition /dev/md127p3 size from 8053063680 to 7407140864 bytes
...
Determining disks to be wiped ...
Disks to be completely overwritten: /dev/md127 
RAID device /dev/md127 does not exist - trying to determine the parent disks of its component devices
/dev/sda is a parent of component device /dev/sda 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 of component device /dev/sdb of /dev/md127 that should be wiped
Adding parent /dev/sdb to be wiped (/dev/sdb is not write-protected)
Disks to be wiped: /dev/sda /dev/sdb 
...
Start system layout restoration.
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''
Disk '/dev/md127': creating partition number 3 with name ''md127p3''
Creating filesystem of type btrfs with mount point / on /dev/md127p3.
Mounting filesystem /
Creating swap on /dev/md127p2
Disk layout created.
...
Backup restore program 'tar' started ...
...
Restoring finished ...
...
Installing GRUB2 on /dev/sda (/dev/sda in GRUB2_INSTALL_DEVICES is mapped to /dev/sda in /var/lib/rear/layout/disk_mappings)
Installing GRUB2 on /dev/sdb (/dev/sdb in GRUB2_INSTALL_DEVICES is mapped to /dev/sdb in /var/lib/rear/layout/disk_mappings)
...
Finished 'recover'.

RESCUE localhost:~ # reboot

Rebooted replacement system after "rear recover":

# parted -s /dev/sda unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 8.00GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system     Name     Flags
 1      0.00GiB  0.10GiB  0.10GiB                  md127p1  bios_grub
 2      0.10GiB  1.10GiB  1.00GiB  linux-swap(v1)  md127p2  swap
 3      1.10GiB  8.00GiB  6.90GiB  btrfs           md127p3

# parted -s /dev/sdb unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdb: 10.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system     Name     Flags
 1      0.00GiB  0.10GiB  0.10GiB                  md127p1  bios_grub
 2      0.10GiB  1.10GiB  1.00GiB  linux-swap(v1)  md127p2  swap
 3      1.10GiB  8.00GiB  6.90GiB  btrfs           md127p3

# lsblk -ipo NAME,TYPE,FSTYPE,SIZE
NAME             TYPE  FSTYPE             SIZE
/dev/sda         disk  linux_raid_member    8G
`-/dev/md127     raid1                      8G
  |-/dev/md127p1 part                     102M
  |-/dev/md127p2 part  swap                 1G
  `-/dev/md127p3 part  btrfs              6.9G
/dev/sdb         disk  linux_raid_member   10G
`-/dev/md127     raid1                      8G
  |-/dev/md127p1 part                     102M
  |-/dev/md127p2 part  swap                 1G
  `-/dev/md127p3 part  btrfs              6.9G

# findmnt -a -t btrfs -o TARGET,SOURCE
TARGET                   SOURCE
/                        /dev/md127p3[/@]
|-/boot/grub2/x86_64-efi /dev/md127p3[/@/boot/grub2/x86_64-efi]
|-/home                  /dev/md127p3[/@/home]
|-/opt                   /dev/md127p3[/@/opt]
|-/boot/grub2/i386-pc    /dev/md127p3[/@/boot/grub2/i386-pc]
|-/root                  /dev/md127p3[/@/root]
|-/srv                   /dev/md127p3[/@/srv]
|-/var                   /dev/md127p3[/@/var]
|-/tmp                   /dev/md127p3[/@/tmp]
`-/usr/local             /dev/md127p3[/@/usr/local]

Migration to replacement system with smaller 8 GB sda and smaller 7 GB sdb

Works with adapted AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE because sdb is shrinked by more than 20%.

Rebooted replacement system after "rear recover":

# parted -s /dev/sda unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 8.00GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system     Name     Flags
 1      0.00GiB  0.10GiB  0.10GiB                  md127p1  bios_grub
 2      0.10GiB  1.10GiB  1.00GiB  linux-swap(v1)  md127p2  swap
 3      1.10GiB  7.00GiB  5.90GiB  btrfs           md127p3

# parted -s /dev/sdb unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdb: 7.00GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system     Name     Flags
 1      0.00GiB  0.10GiB  0.10GiB                  md127p1  bios_grub
 2      0.10GiB  1.10GiB  1.00GiB  linux-swap(v1)  md127p2  swap
 3      1.10GiB  7.00GiB  5.90GiB  btrfs           md127p3

# lsblk -ipo NAME,TYPE,FSTYPE,SIZE
NAME             TYPE  FSTYPE             SIZE
/dev/sda         disk  linux_raid_member    8G
`-/dev/md127     raid1                      7G
  |-/dev/md127p1 part                     102M
  |-/dev/md127p2 part  swap                 1G
  `-/dev/md127p3 part  btrfs              5.9G
/dev/sdb         disk  linux_raid_member    7G
`-/dev/md127     raid1                      7G
  |-/dev/md127p1 part                     102M
  |-/dev/md127p2 part  swap                 1G
  `-/dev/md127p3 part  btrfs              5.9G

# findmnt -a -t btrfs -o TARGET,SOURCE
TARGET                   SOURCE
/                        /dev/md127p3[/@]
|-/boot/grub2/x86_64-efi /dev/md127p3[/@/boot/grub2/x86_64-efi]
|-/opt                   /dev/md127p3[/@/opt]
|-/boot/grub2/i386-pc    /dev/md127p3[/@/boot/grub2/i386-pc]
|-/home                  /dev/md127p3[/@/home]
|-/usr/local             /dev/md127p3[/@/usr/local]
|-/root                  /dev/md127p3[/@/root]
|-/srv                   /dev/md127p3[/@/srv]
|-/tmp                   /dev/md127p3[/@/tmp]
`-/var                   /dev/md127p3[/@/var]

Migration to replacement system with bigger 11 GB sda and same size 10 GB sdb

During "rear recover" (all migration mode user confirmation dialogs were accepted unaltered):

RESCUE localhost:~ # rear -D recover
...
Comparing disks
Device sda has size 11811160064 bytes but 9663676416 bytes is expected (needs manual configuration)
Device sdb has expected (same) size 10737418240 bytes (will be used for 'recover')
Switching to manual disk layout configuration (GiB sizes rounded down to integer)
/dev/sda had size 9663676416 (9 GiB) but is now 11811160064 (11 GiB)
/dev/sdb has same size 10737418240 (10 GiB)
Could not automap /dev/sda (no disk with same size 9663676416 found)
Using /dev/sdb (same name and same size 10737418240) for recreating /dev/sdb
Original disk /dev/sda does not exist (with same size) in the target system
Using /dev/sda (the only available of the disks) for recreating /dev/sda
Current disk mapping table (source => target):
  /dev/sdb => /dev/sdb
  /dev/sda => /dev/sda
...
Trying to automatically resize last partition when disk size changed
Examining gpt device /dev/md127 to automatically resize its last active partition
New /dev/md127 is 1073741824 bytes bigger than old device
Checking /dev/md127p1 if it is the last partition on /dev/md127
Checking /dev/md127p2 if it is the last partition on /dev/md127
Checking /dev/md127p3 if it is the last partition on /dev/md127
Found 'rear-noname' partition /dev/md127p3 as last partition on /dev/md127
Determining if last partition /dev/md127p3 is resizeable
Determining new size for last partition /dev/md127p3
Determining if last partition /dev/md127p3 actually needs to be increased or shrinked
Increasing last partition /dev/md127p3 up to end of device (new device at least 10% bigger)
Changed last partition /dev/md127p3 size from 8053063680 to 9554624512 bytes
...
Determining disks to be wiped ...
Disks to be completely overwritten: /dev/md127 
RAID device /dev/md127 does not exist - trying to determine the parent disks of its component devices
/dev/sda is a parent of component device /dev/sda 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 of component device /dev/sdb of /dev/md127 that should be wiped
Adding parent /dev/sdb to be wiped (/dev/sdb is not write-protected)
Disks to be wiped: /dev/sda /dev/sdb 
...
Start system layout restoration.
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''
Disk '/dev/md127': creating partition number 3 with name ''md127p3''
Creating filesystem of type btrfs with mount point / on /dev/md127p3.
Mounting filesystem /
Creating swap on /dev/md127p2
Disk layout created.
...
Backup restore program 'tar' started ...
...
Restoring finished ...
...
Installing GRUB2 boot loader...
Installing GRUB2 on /dev/sda (/dev/sda in GRUB2_INSTALL_DEVICES is mapped to /dev/sda in /var/lib/rear/layout/disk_mappings)
Installing GRUB2 on /dev/sdb (/dev/sdb in GRUB2_INSTALL_DEVICES is mapped to /dev/sdb in /var/lib/rear/layout/disk_mappings)
...
Finished 'recover'.

RESCUE localhost:~ # reboot

Rebooted replacement system after "rear recover":

# parted -s /dev/sda unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 11.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system     Name     Flags
 1      0.00GiB  0.10GiB  0.10GiB                  md127p1  bios_grub
 2      0.10GiB  1.10GiB  1.00GiB  linux-swap(v1)  md127p2  swap
 3      1.10GiB  10.0GiB  8.90GiB  btrfs           md127p3

# parted -s /dev/sdb unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdb: 10.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system     Name     Flags
 1      0.00GiB  0.10GiB  0.10GiB                  md127p1  bios_grub
 2      0.10GiB  1.10GiB  1.00GiB  linux-swap(v1)  md127p2  swap
 3      1.10GiB  10.0GiB  8.90GiB  btrfs           md127p3

# lsblk -ipo NAME,TYPE,FSTYPE,SIZE
NAME             TYPE  FSTYPE             SIZE
/dev/sda         disk  linux_raid_member   11G
`-/dev/md127     raid1                     10G
  |-/dev/md127p1 part                     102M
  |-/dev/md127p2 part  swap                 1G
  `-/dev/md127p3 part  btrfs              8.9G
/dev/sdb         disk  linux_raid_member   10G
`-/dev/md127     raid1                     10G
  |-/dev/md127p1 part                     102M
  |-/dev/md127p2 part  swap                 1G
  `-/dev/md127p3 part  btrfs              8.9G

# findmnt -a -t btrfs -o TARGET,SOURCE
TARGET                   SOURCE
/                        /dev/md127p3[/@]
|-/home                  /dev/md127p3[/@/home]
|-/boot/grub2/i386-pc    /dev/md127p3[/@/boot/grub2/i386-pc]
|-/boot/grub2/x86_64-efi /dev/md127p3[/@/boot/grub2/x86_64-efi]
|-/srv                   /dev/md127p3[/@/srv]
|-/opt                   /dev/md127p3[/@/opt]
|-/root                  /dev/md127p3[/@/root]
|-/tmp                   /dev/md127p3[/@/tmp]
|-/usr/local             /dev/md127p3[/@/usr/local]
`-/var                   /dev/md127p3[/@/var]

Migration to replacement system with bigger 11 GB sda and bigger 12 GB sdb

Rebooted replacement system after "rear recover":

# parted -s /dev/sda unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 11.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system     Name     Flags
 1      0.00GiB  0.10GiB  0.10GiB                  md127p1  bios_grub
 2      0.10GiB  1.10GiB  1.00GiB  linux-swap(v1)  md127p2  swap
 3      1.10GiB  11.0GiB  9.90GiB  btrfs           md127p3

# parted -s /dev/sdb unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdb: 12.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system     Name     Flags
 1      0.00GiB  0.10GiB  0.10GiB                  md127p1  bios_grub
 2      0.10GiB  1.10GiB  1.00GiB  linux-swap(v1)  md127p2  swap
 3      1.10GiB  11.0GiB  9.90GiB  btrfs           md127p3

# lsblk -ipo NAME,TYPE,FSTYPE,SIZE
NAME             TYPE  FSTYPE             SIZE
/dev/sda         disk  linux_raid_member   11G
`-/dev/md127     raid1                     11G
  |-/dev/md127p1 part                     102M
  |-/dev/md127p2 part  swap                 1G
  `-/dev/md127p3 part  btrfs              9.9G
/dev/sdb         disk  linux_raid_member   12G
`-/dev/md127     raid1                     11G
  |-/dev/md127p1 part                     102M
  |-/dev/md127p2 part  swap                 1G
  `-/dev/md127p3 part  btrfs              9.9G

# findmnt -a -t btrfs -o TARGET,SOURCE
TARGET                   SOURCE
/                        /dev/md127p3[/@]
|-/opt                   /dev/md127p3[/@/opt]
|-/boot/grub2/i386-pc    /dev/md127p3[/@/boot/grub2/i386-pc]
|-/boot/grub2/x86_64-efi /dev/md127p3[/@/boot/grub2/x86_64-efi]
|-/var                   /dev/md127p3[/@/var]
|-/home                  /dev/md127p3[/@/home]
|-/tmp                   /dev/md127p3[/@/tmp]
|-/root                  /dev/md127p3[/@/root]
|-/srv                   /dev/md127p3[/@/srv]
`-/usr/local             /dev/md127p3[/@/usr/local]

SLES15 SP4 with RAID0 migrated to replacement systems with smaller and bigger disk size

Original system with 9 GB sda and 10 GB sdb

# parted -s /dev/sda unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 9.00GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot
Number  Start    End      Size     File system  Name  Flags
 1      0.00GiB  0.01GiB  0.01GiB                     bios_grub
 2      0.01GiB  0.21GiB  0.20GiB  ext4               legacy_boot
 3      0.21GiB  8.71GiB  8.50GiB                     raid

# parted -s /dev/sdb unit GiB print
Error: /dev/sdb: unrecognised disk label
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdb: 10.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

# lsblk -ipo NAME,TYPE,FSTYPE,SIZE
NAME               TYPE  FSTYPE             SIZE
/dev/sda           disk                       9G
|-/dev/sda1        part                       8M
|-/dev/sda2        part  ext4               204M
`-/dev/sda3        part  linux_raid_member  8.5G
  `-/dev/md127     raid0                   18.5G
    `-/dev/md127p1 part  btrfs               18G
/dev/sdb           disk  linux_raid_member   10G
`-/dev/md127       raid0                   18.5G
  `-/dev/md127p1   part  btrfs               18G

# findmnt -a -t btrfs,ext4 -o TARGET,SOURCE,FSTYPE
TARGET        SOURCE                                 FSTYPE
/             /dev/md127p1[/@/.snapshots/1/snapshot] btrfs
|-/opt        /dev/md127p1[/@/opt]                   btrfs
|-/usr/local  /dev/md127p1[/@/usr/local]             btrfs
|-/srv        /dev/md127p1[/@/srv]                   btrfs
|-/.snapshots /dev/md127p1[/@/.snapshots]            btrfs
|-/home       /dev/md127p1[/@/home]                  btrfs
|-/var        /dev/md127p1[/@/var]                   btrfs
|-/root       /dev/md127p1[/@/root]                  btrfs
|-/tmp        /dev/md127p1[/@/tmp]                   btrfs
`-/boot       /dev/sda2                              ext4

# 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=( /home /opt /root /srv /usr/local /tmp /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"
DISKS_TO_BE_WIPED=''
GRUB2_INSTALL_DEVICES="/dev/sda"
AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE=20
AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE=10

Migration to replacement system with smaller 8 GB sda and same size 10 GB sdb

During "rear recover" (all migration mode user confirmation dialogs were accepted unaltered):

RESCUE localhost:~ # rear -D recover
...
Comparing disks
Device sda has size 8589934592 bytes but 9663676416 bytes is expected (needs manual configuration)
Device sdb has expected (same) size 10737418240 bytes (will be used for 'recover')
Switching to manual disk layout configuration (GiB sizes rounded down to integer)
/dev/sda had size 9663676416 (9 GiB) but is now 8589934592 (8 GiB)
/dev/sdb has same size 10737418240 (10 GiB)
Could not automap /dev/sda (no disk with same size 9663676416 found)
Using /dev/sdb (same name and same size 10737418240) for recreating /dev/sdb
Original disk /dev/sda does not exist (with same size) in the target system
Using /dev/sda (the only available of the disks) for recreating /dev/sda
Current disk mapping table (source => target):
  /dev/sdb => /dev/sdb
  /dev/sda => /dev/sda
...
Trying to automatically resize last partition when disk size changed
Examining gpt device /dev/sda to automatically resize its last active partition
New /dev/sda is 1073741824 bytes smaller than old device
Checking /dev/sda1 if it is the last partition on /dev/sda
Checking /dev/sda2 if it is the last partition on /dev/sda
Checking /dev/sda3 if it is the last partition on /dev/sda
Found 'rear-noname' partition /dev/sda3 as last partition on /dev/sda
Determining if last partition /dev/sda3 is resizeable
Determining new size for last partition /dev/sda3
Determining if last partition /dev/sda3 actually needs to be increased or shrinked
Last partition /dev/sda3 must be shrinked by 761266176 bytes to still fit on device
Shrinking last partition /dev/sda3 to end of device (new device at most 20% smaller)
Changed last partition /dev/sda3 size from 9126805504 to 8365539328 bytes
Examining gpt device /dev/md127 to automatically resize its last active partition
New /dev/md127 is 1073741824 bytes smaller than old device
Checking /dev/md127p1 if it is the last partition on /dev/md127
Found 'rear-noname' partition /dev/md127p1 as last partition on /dev/md127
Determining if last partition /dev/md127p1 is resizeable
Determining new size for last partition /dev/md127p1
Determining if last partition /dev/md127p1 actually needs to be increased or shrinked
Last partition /dev/md127p1 must be shrinked by 538968064 bytes to still fit on device
Shrinking last partition /dev/md127p1 to end of device (new device at most 20% smaller)
Changed last partition /dev/md127p1 size from 19327352832 to 18788384768 bytes
...
Determining disks to be wiped ...
Disks to be completely overwritten: /dev/md127 /dev/sda 
RAID device /dev/md127 does not exist - trying to determine the parent disks of its component devices
/dev/sdb is a parent of component device /dev/sdb of /dev/md127 that should be wiped
Adding parent /dev/sdb to be wiped (/dev/sdb is not write-protected)
Disks to be wiped: /dev/sdb /dev/sda
...
Start system layout restoration.
Disk '/dev/sda': creating 'gpt' partition table
Disk '/dev/sda': creating partition number 1 with name ''sda1''
Disk '/dev/sda': creating partition number 2 with name ''sda2''
Disk '/dev/sda': creating partition number 3 with name ''sda3''
Creating software RAID /dev/md127
Disk '/dev/md127': creating 'gpt' partition table
Disk '/dev/md127': creating partition number 1 with name ''md127p1''
Creating filesystem of type btrfs with mount point / on /dev/md127p1.
Mounting filesystem /
Running snapper/installation-helper
Creating filesystem of type ext4 with mount point /boot on /dev/sda2.
Mounting filesystem /boot
Disk layout created.
...
Backup restore program 'tar' started ...
...
Restoring finished ...
...
Installing GRUB2 boot loader...
Installing GRUB2 on /dev/sda (/dev/sda in GRUB2_INSTALL_DEVICES is mapped to /dev/sda in /var/lib/rear/layout/disk_mappings)
...
Finished 'recover'.

RESCUE localhost:~ # reboot

Rebooted replacement system after "rear recover":

# parted -s /dev/sda unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 8.00GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system  Name  Flags
 1      0.00GiB  0.01GiB  0.01GiB               sda1  bios_grub
 2      0.01GiB  0.21GiB  0.20GiB  ext4         sda2  legacy_boot
 3      0.21GiB  8.00GiB  7.79GiB               sda3  raid

# parted -s /dev/sdb unit GiB print
Error: /dev/sdb: unrecognised disk label
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdb: 10.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

# lsblk -ipo NAME,TYPE,FSTYPE,SIZE
NAME               TYPE  FSTYPE             SIZE
/dev/sda           disk                       8G
|-/dev/sda1        part                       8M
|-/dev/sda2        part  ext4               204M
`-/dev/sda3        part  linux_raid_member  7.8G
  `-/dev/md127     raid0                   17.8G
    `-/dev/md127p1 part  btrfs             17.5G
/dev/sdb           disk  linux_raid_member   10G
`-/dev/md127       raid0                   17.8G
  `-/dev/md127p1   part  btrfs             17.5G

# findmnt -a -t btrfs,ext4 -o TARGET,SOURCE,FSTYPE
TARGET        SOURCE                                 FSTYPE
/             /dev/md127p1[/@/.snapshots/1/snapshot] btrfs
|-/var        /dev/md127p1[/@/var]                   btrfs
|-/opt        /dev/md127p1[/@/opt]                   btrfs
|-/.snapshots /dev/md127p1[/@/.snapshots]            btrfs
|-/home       /dev/md127p1[/@/home]                  btrfs
|-/root       /dev/md127p1[/@/root]                  btrfs
|-/srv        /dev/md127p1[/@/srv]                   btrfs
|-/tmp        /dev/md127p1[/@/tmp]                   btrfs
|-/usr/local  /dev/md127p1[/@/usr/local]             btrfs
`-/boot       /dev/sda2                              ext4

Migration to replacement system with smaller 8 GB sda and smaller 7 GB sdb

Works with adapted AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE because sdb is shrinked by more than 20%.

Rebooted replacement system after "rear recover":

# parted -s /dev/sda unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 8.00GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system  Name  Flags
 1      0.00GiB  0.01GiB  0.01GiB               sda1  bios_grub
 2      0.01GiB  0.21GiB  0.20GiB  ext4         sda2  legacy_boot
 3      0.21GiB  8.00GiB  7.79GiB               sda3  raid

# parted -s /dev/sdb unit GiB print
Error: /dev/sdb: unrecognised disk label
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdb: 7.00GiB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

# lsblk -ipo NAME,TYPE,FSTYPE,SIZE
NAME               TYPE  FSTYPE             SIZE
/dev/sda           disk                       8G
|-/dev/sda1        part                       8M
|-/dev/sda2        part  ext4               204M
`-/dev/sda3        part  linux_raid_member  7.8G
  `-/dev/md127     raid0                   14.8G
    `-/dev/md127p1 part  btrfs             14.5G
/dev/sdb           disk  linux_raid_member    7G
`-/dev/md127       raid0                   14.8G
  `-/dev/md127p1   part  btrfs             14.5G

# findmnt -a -t btrfs,ext4 -o TARGET,SOURCE,FSTYPE
TARGET        SOURCE                                 FSTYPE
/             /dev/md127p1[/@/.snapshots/1/snapshot] btrfs
|-/opt        /dev/md127p1[/@/opt]                   btrfs
|-/home       /dev/md127p1[/@/home]                  btrfs
|-/tmp        /dev/md127p1[/@/tmp]                   btrfs
|-/var        /dev/md127p1[/@/var]                   btrfs
|-/.snapshots /dev/md127p1[/@/.snapshots]            btrfs
|-/root       /dev/md127p1[/@/root]                  btrfs
|-/srv        /dev/md127p1[/@/srv]                   btrfs
|-/usr/local  /dev/md127p1[/@/usr/local]             btrfs
`-/boot       /dev/sda2                              ext4

Migration to replacement system with bigger 11 GB sda and same size 10 GB sdb

During "rear recover" (all migration mode user confirmation dialogs were accepted unaltered):

RESCUE localhost:~ # rear -D recover
...
Comparing disks
Device sda has size 11811160064 bytes but 9663676416 bytes is expected (needs manual configuration)
Device sdb has expected (same) size 10737418240 bytes (will be used for 'recover')
Switching to manual disk layout configuration (GiB sizes rounded down to integer)
/dev/sda had size 9663676416 (9 GiB) but is now 11811160064 (11 GiB)
/dev/sdb has same size 10737418240 (10 GiB)
Could not automap /dev/sda (no disk with same size 9663676416 found)
Using /dev/sdb (same name and same size 10737418240) for recreating /dev/sdb
Original disk /dev/sda does not exist (with same size) in the target system
Using /dev/sda (the only available of the disks) for recreating /dev/sda
Current disk mapping table (source => target):
  /dev/sdb => /dev/sdb
  /dev/sda => /dev/sda
...
Trying to automatically resize last partition when disk size changed
Examining gpt device /dev/sda to automatically resize its last active partition
New /dev/sda is 2147483648 bytes bigger than old device
Checking /dev/sda1 if it is the last partition on /dev/sda
Checking /dev/sda2 if it is the last partition on /dev/sda
Checking /dev/sda3 if it is the last partition on /dev/sda
Found 'rear-noname' partition /dev/sda3 as last partition on /dev/sda
Determining if last partition /dev/sda3 is resizeable
Determining new size for last partition /dev/sda3
Determining if last partition /dev/sda3 actually needs to be increased or shrinked
Increasing last partition /dev/sda3 up to end of device (new device at least 10% bigger)
Changed last partition /dev/sda3 size from 9126805504 to 11586764800 bytes
Examining gpt device /dev/md127 to automatically resize its last active partition
New /dev/md127 is 2147483648 bytes bigger than old device
Checking /dev/md127p1 if it is the last partition on /dev/md127
Found 'rear-noname' partition /dev/md127p1 as last partition on /dev/md127
Determining if last partition /dev/md127p1 is resizeable
Determining new size for last partition /dev/md127p1
Determining if last partition /dev/md127p1 actually needs to be increased or shrinked
Increasing last partition /dev/md127p1 up to end of device (new device at least 10% bigger)
Changed last partition /dev/md127p1 size from 19327352832 to 22009610240 bytes
...
Determining disks to be wiped ...
Disks to be completely overwritten: /dev/md127 /dev/sda 
RAID device /dev/md127 does not exist - trying to determine the parent disks of its component devices
/dev/sdb is a parent of component device /dev/sdb of /dev/md127 that should be wiped
Adding parent /dev/sdb to be wiped (/dev/sdb is not write-protected)
Disks to be wiped: /dev/sdb /dev/sda 
...
Start system layout restoration.
Disk '/dev/sda': creating 'gpt' partition table
Disk '/dev/sda': creating partition number 1 with name ''sda1''
Disk '/dev/sda': creating partition number 2 with name ''sda2''
Disk '/dev/sda': creating partition number 3 with name ''sda3''
Creating software RAID /dev/md127
Disk '/dev/md127': creating 'gpt' partition table
Disk '/dev/md127': creating partition number 1 with name ''md127p1''
Creating filesystem of type btrfs with mount point / on /dev/md127p1.
Mounting filesystem /
Running snapper/installation-helper
Creating filesystem of type ext4 with mount point /boot on /dev/sda2.
Mounting filesystem /boot
Disk layout created.
...
Backup restore program 'tar' started ...
...
Restoring finished ...
...
Installing GRUB2 boot loader...
Installing GRUB2 on /dev/sda (/dev/sda in GRUB2_INSTALL_DEVICES is mapped to /dev/sda in /var/lib/rear/layout/disk_mappings)
...
Finished 'recover'.

RESCUE localhost:~ # reboot

Rebooted replacement system after "rear recover":

# parted -s /dev/sda unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 11.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system  Name  Flags
 1      0.00GiB  0.01GiB  0.01GiB               sda1  bios_grub
 2      0.01GiB  0.21GiB  0.20GiB  ext4         sda2  legacy_boot
 3      0.21GiB  11.0GiB  10.8GiB               sda3  raid

# parted -s /dev/sdb unit GiB print
Error: /dev/sdb: unrecognised disk label
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdb: 10.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

# lsblk -ipo NAME,TYPE,FSTYPE,SIZE
NAME               TYPE  FSTYPE             SIZE
/dev/sda           disk                      11G
|-/dev/sda1        part                       8M
|-/dev/sda2        part  ext4               204M
`-/dev/sda3        part  linux_raid_member 10.8G
  `-/dev/md127     raid0                   20.8G
    `-/dev/md127p1 part  btrfs             20.5G
/dev/sdb           disk  linux_raid_member   10G
`-/dev/md127       raid0                   20.8G
  `-/dev/md127p1   part  btrfs             20.5G

# findmnt -a -t btrfs,ext4 -o TARGET,SOURCE,FSTYPE
TARGET        SOURCE                                 FSTYPE
/             /dev/md127p1[/@/.snapshots/1/snapshot] btrfs
|-/var        /dev/md127p1[/@/var]                   btrfs
|-/opt        /dev/md127p1[/@/opt]                   btrfs
|-/.snapshots /dev/md127p1[/@/.snapshots]            btrfs
|-/home       /dev/md127p1[/@/home]                  btrfs
|-/tmp        /dev/md127p1[/@/tmp]                   btrfs
|-/root       /dev/md127p1[/@/root]                  btrfs
|-/srv        /dev/md127p1[/@/srv]                   btrfs
|-/usr/local  /dev/md127p1[/@/usr/local]             btrfs
`-/boot       /dev/sda2                              ext4

Migration to replacement system with bigger 11 GB sda and bigger 12 GB sdb

Rebooted replacement system after "rear recover":

# parted -s /dev/sda unit GiB print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 11.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
Number  Start    End      Size     File system  Name  Flags
 1      0.00GiB  0.01GiB  0.01GiB               sda1  bios_grub
 2      0.01GiB  0.21GiB  0.20GiB  ext4         sda2  legacy_boot
 3      0.21GiB  11.0GiB  10.8GiB               sda3  raid

# parted -s /dev/sdb unit GiB print
Error: /dev/sdb: unrecognised disk label
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sdb: 12.0GiB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

# lsblk -ipo NAME,TYPE,FSTYPE,SIZE
NAME               TYPE  FSTYPE             SIZE
/dev/sda           disk                      11G
|-/dev/sda1        part                       8M
|-/dev/sda2        part  ext4               204M
`-/dev/sda3        part  linux_raid_member 10.8G
  `-/dev/md127     raid0                   22.8G
    `-/dev/md127p1 part  btrfs             22.5G
/dev/sdb           disk  linux_raid_member   12G
`-/dev/md127       raid0                   22.8G
  `-/dev/md127p1   part  btrfs             22.5G

# findmnt -a -t btrfs,ext4 -o TARGET,SOURCE,FSTYPE
TARGET        SOURCE                                 FSTYPE
/             /dev/md127p1[/@/.snapshots/1/snapshot] btrfs
|-/opt        /dev/md127p1[/@/opt]                   btrfs
|-/root       /dev/md127p1[/@/root]                  btrfs
|-/.snapshots /dev/md127p1[/@/.snapshots]            btrfs
|-/home       /dev/md127p1[/@/home]                  btrfs
|-/srv        /dev/md127p1[/@/srv]                   btrfs
|-/var        /dev/md127p1[/@/var]                   btrfs
|-/tmp        /dev/md127p1[/@/tmp]                   btrfs
|-/usr/local  /dev/md127p1[/@/usr/local]             btrfs
`-/boot       /dev/sda2                              ext4

RHEL

RHEL 9beta (BACKUP=NETFS)

  • Relax-and-Recover rear-2.6.8.el9.x86_64
  • Internal backup with tar
  • boot method: ISO
  • Disk layout:
NAME          FSTYPE        SIZE MOUNTPOINT
sda                           8G 
|-sda1        xfs             1G /boot
`-sda2        LVM2_member     7G 
  |-rhel-root xfs           6.2G /
  `-rhel-swap swap          820M [SWAP]
  • /etc/rear/local.conf:
BACKUP=NETFS
BACKUP_URL=nfs://10.0.2.2/export/nfs

FIRMWARE_FILES=( 'no' )

SSH_ROOT_PASSWORD="vagrant"
  • test result: recover went fine, however, we saw an error "Cannot create initrd (found no mkinitrd in the recreated system)"

CentOS

CentOS 8 (BACKUP=BAREOS)

  • Relax-and-Recover rear-2.6.5-1.el7.x86_64
  • External backup with Bareos 19.2.7-2
  • boot method: ISO/PXE
  • Disk layout:
lsblk -io NAME,FSTYPE,SIZE,MOUNTPOINT
NAME        FSTYPE        SIZE MOUNTPOINT
sda                      50.5G 
|-sda1      ext4            1G /boot
`-sda2      LVM2_member  49.5G 
  |-cl-root xfs          27.4G /
  |-cl-swap swap          2.2G [SWAP]
  `-cl-home xfs            20G /home
sdb                        70G 
  • /etc/rear/local.conf:
OUTPUT=ISO
OUTPUT_URL=nfs://10.0.2.2/root/.config/VirtualBox/TFTP/isos
OUTPUT_OPTIONS="nfsvers=3,nolock"

# BAREOS specific definitions
BACKUP=BAREOS
BAREOS_RESTORE_JOB=client-restore
BAREOS_FILESET=client-fileset
BAREOS_RECOVERY_MODE="automatic"

# run a bareos backup with bareos to have a full/incremental backup of the 'client'
PRE_BACKUP_SCRIPT=/usr/local/bin/client-backup-with-bareos

# we need to start the NFS sub-system as we needed it for mounting the PXE_CONFIG_URL
# With BACKUP=NETFS it is there by nature, but with BAREOS that is not the case
PROGS=( "${PROGS[@]}" showmount mount.nfs umount.nfs )
MODULES=( "${MODULES[@]}" nfs )
# the OR rpcbind is especially for SLES11 which has no systemd onboard
PRE_RECOVERY_SCRIPT="systemctl start rpcbind.target || rpcbind &"

# This we need as we use PXE booting, but use a trick to boot the ISO image (with memdisk)
#PXE_CONFIG_URL=nfs://10.0.2.2/root/.config/VirtualBox/TFTP/pxelinux.cfg
PXE_CONFIG_URL=nfs://10.0.2.2/root/.config/VirtualBox/TFTP/pxelinux.cfg

# unattended means auto_recover with no questions asked (expert mode)
# We tend to use this for our automated test environment and we
# expect that you know what you are doing - if not - hire us 
ISO_DEFAULT="automatic"
ISO_RECOVER_MODE="unattended"

USE_STATIC_NETWORKING=y
# Update kernel options to have eth0/eth1 - see https://github.com/gdha/rear-automated-testing/issues/6
KERNEL_CMDLINE="$KERNEL_CMDLINE net.ifnames=0"

# To reduce the size of the ISO image
# before 112MB; after 60MB
FIRMWARE_FILES=( 'no' )

SSH_ROOT_PASSWORD="vagrant"

# To assure the time in the log file is correct
TIMESYNC=NTPDATE
TIMESYNC_SOURCE=0.pool.ntp.org
TEST_LOG_DIR_URL=nfs://10.0.2.2/export/rear-tests/logs/2021-12-13_09-12-33