Sunday, 27 September 2026

System restoration with REAR

 Boot from recovery iso on pihole

if replacing a drive, smart array will detect a change and disable logical drive and boot will hang at smart array initialisation.  
Make sure you reboot with text mode and select F2 to reenable drive array


Log in using standard root password over network
Recover einstein option

Should see 3 drives sda/sdb/sdc

mount the backup partition - it will be the one with the single partition
Device     Start        End    Sectors  Size Type
/dev/sdc1   2048 6251167743 6251165696  2.9T Linux filesystem
RESCUE einstein:~ # mkdir /backup
RESCUE einstein:~ # mount /dev/sdc1 /backup

Of the other 2, run pvs to determine which one is not the volume with all the guest lvms on it
RESCUE einstein:~ # pvs
  PV         VG            Fmt  Attr PSize   PFree
  /dev/sda2  rhel_einstein lvm2 a--  <50.00g <25.75g
  /dev/sdb   vg_guests     lvm2 a--    2.91t   1.86t

In this case it's sda that is the OS disk so ensure rear uses that

RESCUE einstein:~ # rear recover
Relax-and-Recover 2.6 / 2020-06-17
Running rear recover (PID 814)
Using log file: /var/log/rear/rear-einstein.log
Running workflow recover within the ReaR rescue/recovery system
Using backup archive '/backup/host/einstein/backup.tar.gz'
Will do driver migration (recreating initramfs/initrd)
Calculating backup archive size
Backup archive size is 4.6G     /backup/host/einstein/backup.tar.gz (compressed)
Comparing disks
Ambiguous possible target disks need manual configuration (more than one with same size found)
Switching to manual disk layout configuration
Using /dev/sdb (same name and same size 3200598237184) for recreating /dev/sdb
Current disk mapping table (source => target):
  /dev/sdb => /dev/sdb

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'


It's picked the wrong one - so change with option 3
Current disk mapping table (source => target):
  /dev/sdb => /dev/sda

Confirm or edit the disk mapping
1) Confirm disk mapping and continue 'rear recover'
2) n/a
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'

It will probably crash out
User confirmed disk mapping
Failed to apply layout mappings to /var/lib/rear/layout/config/df.txt for /dev/sda (probably no mapping for /dev/sda in /var/lib/rear/layout/disk_mappings)
Failed to apply disk layout mappings to /var/lib/rear/layout/config/df.txt
ERROR: Failed to apply disk layout mappings
Some latest log messages since the last called script 320_apply_mappings.sh:
  2026-09-27 16:22:17.927699482 Including layout/prepare/default/320_apply_mappings.sh
  2026-09-27 16:22:18.003792169 Failed to apply layout mappings to /var/lib/rear/layout/config/df.txt for /dev/sda (probably no mapping for /dev/sda in /var/lib/rear/layout/disk_mappings)
  2026-09-27 16:22:18.006684154 Failed to apply disk layout mappings to /var/lib/rear/layout/config/df.txt
Aborting due to an error, check /var/log/rear/rear-einstein.log for details
Exiting rear recover (PID 814) and its descendant processes ...
Running exit tasks
Terminated


So run it again and you should see this time it has the correct disk selected
Current disk mapping table (source => target):
  /dev/sda => /dev/sda

So proceed with recovery, option 1 will need to be selected multiple times

It will crash out with this error, but that's just a bug. reboot and all will be well.
there will be a double reboot for an SELINUX relabel.
ERROR:
====================
BUG in /usr/share/rear/lib/framework-functions.sh line 138:
'Directory /tmp/rear.4QIY3CICzHmVnSd/outputfs not empty, can not remove'
--------------------


after reboot check grub params
[root@einstein ~]# grub2-editenv - list
saved_entry=f32f63b9b0ac4d68aa0ab7e6a76c2f35-5.14.0-687.52.1.el9_8.x86_64
menu_auto_hide=1
boot_success=0
boot_indeterminate=0


if you don't see a menu_auto_hide at it back in
Rear recreates a brand new config rather than copying an existing one and this option isn't set by default.
sudo grub2-editenv - set menu_auto_hide=1


That should do it but if not do this as well, but shouldn't be necessary.
sudo grub2-mkconfig -o /boot/grub2/grub.cfg