IBM Support

Backup/Restore a server with iscsi multipath root disk using ReaR

How To


Summary

This demo was tested on RHEL 7.8 server where the root file system is installed on a multipath iscsi device. It was then backed up into an ISO image and restored on a new server with a similar iscsi disk mapped to it.

Objective

The purpose of this demo is to restore a ReaR backup taken from a Red Hat server to a new server that is mapped to a similar iscsi disk over multipath.

Environment

  • Red Hat Enterprise Linux Server release 7
The original server initiator name is iqn.2020-08.com.redhat and the root disk is presented through 2 targets:
iqn.2020-08.com.redhat:target1,192.168.122.253,3260,1,default
iqn.2020-08.com.redhat:target2,192.168.122.253,3260,1,default
The new server initiator name used in the demo is iqn.2020-08.com.redhat:rear and it's mapped to iscsi disk presented via the below targets:
iqn.2020-08.com.redhat:target3,192.168.122.253,3260,1,default
iqn.2020-08.com.redhat:target4,192.168.122.253,3260,1,default

Steps

Backup steps:
01- On the original server, modify the /etc/rear/local.conf as follows:
  # Don't exclude multipath disks and their dependent components  AUTOEXCLUDE_MULTIPATH=n    # To support iscsi (https://github.com/rear/rear/issues/64)  COPY_AS_IS=( "${COPY_AS_IS[@]}" /var/lib/iscsi /etc/iscsi )  PROGS=( "${PROGS[@]}" iscsiadm iscsid )  LIBS=( "${LIBS[@]}" libaio* )    # Create a bootable rescue image and include the backup within the ISO file  OUTPUT=ISO  OUTPUT_URL=null  BACKUP=NETFS  BACKUP_URL=iso  
02- Run "rear -v mkbackup" to backup the data and generate the rescue media (iso file). The default path under which the generated ISO image can be found is: /var/lib/rear/output/
Recovery steps:
01- Attach the ISO to CD/DVD or use any method to boot from the image. Boot the system using the rescue ISO image on the new hardware. In the console interface, select the "Recover" option.
image 5748
By selecting this option, rear initialization scripts will be executed and a RESCUE shell will be prompted.
image 5751

Note: To log into the recovery system via ssh set up /root/.ssh/authorized_keys or specify SSH_ROOT_PASSWORD

02- From the RESCUE shell, start multipathd
  RESCUE rhel78:~ # /bin/multipathd
03- Modify the iscsi initiator name & Start iscsid
  RESCUE rhel78:~ # echo 'InitiatorName=iqn.2020-08.com.redhat:rear' > /etc/iscsi/initiatorname.iscsi  RESCUE rhel78:~ # /bin/iscsid
04- iscsi discovery & logining
 
  RESCUE rhel78:~ # iscsiadm --mode discoverydb --type sendtargets --portal 192.168.122.253 --discover  RESCUE rhel78:~ # iscsiadm --mode node --targetname iqn.2020-08.com.redhat:target3 --portal 192.168.122.253 --login  RESCUE rhel78:~ # iscsiadm --mode node --targetname iqn.2020-08.com.redhat:target4 --portal 192.168.122.253 --login  

05- Find out the new wwid of the new device
  RESCUE rhel78:~ # multipath -ll      mpathb (360014057497c01aebf6435da57392be1) dm-0 LIO-ORG ,block2                size=10G features='0' hwhandler='0' wp=rw      |-+- policy='service-time 0' prio=1 status=active      | `- 6:0:0:0 sda 8:0  active ready running      `-+- policy='service-time 0' prio=1 status=enabled        `- 7:0:0:0 sdb 8:16 active ready running
06- Edit /etc/multipath.conf to include an alias for the original disk name (mpatha) 
    multipaths {        multipath {          wwid    360014057497c01aebf6435da57392be1          alias    mpatha        }      }
     
07- Reload multipathd
  RESCUE rhel78:~ # /bin/multipathd reconfigure
08- Verify that the new device exists (with the original name)
  RESCUE rhel78:~ # multipath -ll      mpatha (360014057497c01aebf6435da57392be1) dm-0 LIO-ORG ,block2                size=10G features='0' hwhandler='0' wp=rw      |-+- policy='service-time 0' prio=1 status=active      | `- 6:0:0:0 sda 8:0  active ready running      `-+- policy='service-time 0' prio=1 status=enabled        `- 7:0:0:0 sdb 8:16 active ready running
09- Execute the "rear recover" command to perform the restore. It will first recreate the partition layout and filesystems. Then
it will restore user and system files from the backup into the /mnt/local directory.
10- chroot to the /mnt/local directory
  RESCUE rhel78:~ # mount --rbind /dev/ /mnt/local/dev/  RESCUE rhel78:~ # mount --rbind /sys/ /mnt/local/sys/  RESCUE rhel78:~ # mount --rbind /proc/ /mnt/local/proc/  RESCUE rhel78:~ # chroot /mnt/local/
11- Modify the GRUB_CMDLINE_LINUX with the correct initiator and target names and update grub.cfg with the changes.
  [root@rhel78 /]# cat /etc/default/grub | grep GRUB_CMDLINE_LINUX      GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=rhel/root netroot=iscsi:@192.168.122.253::3260::iqn.2020-08.com.redhat:target3 rd.iscsi.initiator=iqn.2020-08.com.redhat:rear netroot=iscsi:@192.168.122.253::3260::iqn.2020-08.com.redhat:target4 rd.lvm.lv=rhel/home rd.lvm.lv=rhel/swap rhgb quiet ip=eth0:dhcp"    [root@rhel78 /]# grub2-mkconfig -o /boot/grub2/grub.cfg  [root@rhel78 /]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg (For EFI systems)
12- Exit the chroot environment and finish the recovery by entering exit. The server will be automatically rebooted into the recovered system.
  [root@rhel78 /]# exit  RESCUE rhel78:~ # exit  

Document Location

Worldwide

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SGMV157","label":"IBM Support for Red Hat Enterprise Linux Server"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)","Line of Business":{"code":"LOB26","label":"Storage"}}]

Document Information

Modified date:
02 September 2020

UID

ibm16262945