Disaster Recovery of Linux Physical and Virtual Machines
  • 13 Nov 2023
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Disaster Recovery of Linux Physical and Virtual Machines

  • Dark
    Light
  • PDF

Article summary

White Papers

Retrospect 9.5 for Windows and 11.5 for Mac include updated Linux Clients that support recent versions of several Linux server distributions. Considering the differences among the supported Linux configurations, this article outlines the steps to prepare for and perform disaster recovery using Linux Client to a new disk or virtual machine.

Preparing for disaster recovery

Step 1: Back up disk layout and Retrospect Client installer

If you are saving disk layout of /dev/sda to a network or USB volume mounted on /mnt/your_backup:

  • Be careful typing to avoid corrupting your disk: sudo sfdisk –d /dev/sda > /mnt/your_backup/disk_layout.txt
  • cp /etc/fstab /mnt/your_backup
  • If using lvm: cp /etc/lvm/backup/* /mnt/your_backup
  • Also copy the Retrospect Client installer to /mnt/your_backup

Step 2: Use Retrospect to back up applicable volumes

You may be using separate partitions or logical volumes for / (root), /boot, /home and other volumes. Use Retrospect to back up the ones you want to be able to restore.

Step 3: Download Linux LiveCD

Download a LiveCD for the architecture that matches your Linux environment. It simplifies disaster recovery for some Linux configurations, such as those using GRUB 2. We recommend using the Ubuntu 14.04 Desktop LiveCD listed below, but you can use other LiveCDs for distributions supported by Retrospect Client.

Performing disaster recovery

Step 1: Run Linux LiveCD and Retrospect Client

  1. From the running Linux LiveCD environment, start a terminal shell as root
  2. If your LiveCD has firewall enabled (unlike Ubuntu Desktop LiveCD), configure it to allow TCP and UDP connections to port 497
  3. If using LiveCD for x64, install 32-bit glibc libraries:
    • CentOS and RHEL: yum install glibc.i686
    • Debian and Ubuntu: apt-get install libc6-i386
  4. Install Retrospect Client

Step 2: Restore disk layout

If you have previously saved disk layout of /dev/sda to a network or USB volume mounted on /mnt/your_backup:

  1. Be careful typing to avoid corrupting other disks: sfdisk –f /dev/sda < /mnt/your_backup/disk_layout.txt
  2. If using lvm to recreate physical volume and volume group at /dev/sda2:
  3. Find the UUID of original physical volume group (pv0) in /mnt/your_backup/your_lvm_backup_vg_file
  4. pvcreate –uuid "your_pv_uuid" –restorefile /mnt/your_backup/your_lvm_backup_vg_file /dev/sda2
  5. vgcfgrestore -f /mnt/your_backup/your_lvm_backup_vg_file your_original_vg_name
  6. vgchange -a y your_original_vg_name
  7. Format the file systems to be restored using their original UUIDs recorded in /mnt/your_backup/fstab

Step 3: Use Retrospect to restore applicable volumes

In addition to / (root), you would need to restore other volumes (such as /boot or /home) if they are in separate partitions or logical volumes. First mount these volumes (e.g. /mnt/hd_root, /mnt/hd_boot, /mnt/hd_home). Then add the Linux Client as a source for Retrospect to restore to the mounted volumes.

Step 4: Install boot loader to MBR

If using GRUB 0.9x on hd0 with the /boot volume in its first partition:

  1. grub
  2. root (hd0,0)
  3. setup (hd0)

If using GRUB 2 on /dev/sda:

  1. If the boot volume is in separate partition from /mnt/hd_root, mount it on /mnt/hd_root/boot
  2. mount --bind /dev /mnt/hd_root/dev
  3. mount --bind /proc /mnt/hd_root/proc
  4. mount --bind /sys /mnt/hd_root/sys
  5. chroot /mnt/hd_root/
  6. grub-mkconfig –o /boot/grub/grub.cfg
  7. grub-install /dev/sda

Step 5: Final adjustments

  • Use mkswap and swapon to setup the swap area
  • If network MAC addresses have changed, modify /etc/udev/rules.d/70-persistent-net.rules to delete corresponding entries (e.g. eth0) so that they are regenerated on next boot

Last Update: October 1, 2015


Was this article helpful?