Chapter 19. Disaster Recovery with ReaR

Contents

19.1. Conceptual Overview
19.2. Preparing for the Worst Scenarios: Disaster Recovery Plans
19.3. Setting Up ReaR
19.4. Using the YaST ReaR Module
19.5. Setting Up rear-SUSE with AutoYaST
19.6. For More Information

Abstract

ReaR (Relax and Recover) is an administrator tool-set for creating disaster recovery images. The disaster recovery information can either be stored via the network or locally on hard disks, USB devices, DVD/CD-R, tape or similar. The backup data is stored on a network file system (NFS).

Keep in mind, ReaR needs to be configured and tested before any disaster happens. ReaR will not save you, if a disaster has already taken place.

[Warning]Extensive Testing Required

It is essential, whenever you create a rescue CD, to always test the disaster recovery with an identical test machine. Only if this procedure works satisfactorily, your disaster recovery system is correctly and reliably set up.

[Warning]No Version Upgrade for the ReaR Package

SUSE does not deliver any updates for the ReaR package. It cannot be guaranteed that an existing ReaR disaster recovery setup will still work after the upgrade.

If you do a ReaR version upgrade on your own, carefully revalidate that your particular ReaR disaster recovery procedure still works.

19.1. Conceptual Overview

SUSE Linux Enterprise Server ships a disaster recovery system in two packages:

  • rear

  • rear-SUSE

The package rear-SUSE is another method of a disaster recovery which incorporates AutoYaST to recreate your basic system. You should try and test both methods for your systems. Every IT infrastructure is different, in one case rear is enough, in other situations rear-SUSE is a better fit. Regardless of the method, both are used in the following way:

  1. Preparation.  Make a bootable CD and backup system and user data.

  2. Testing.  Test the recovery process thoroughly and the backup on the same hardware as your main system before any disaster happens.

  3. Recovery.  Boot from the rescue CD and restore your system from your backup.

To prepare the rescue media, the following steps are performed by ReaR:

Preparation of Rescue Media by ReaR

  1. Gather system information.

  2. Store disk layout (partitioning, filesystems, LVM, RAID, and boot loader).

  3. Clone the system (Kernel drivers and modules, device driver configuration, network configuration, system software and tools).

  4. Backup system and user data.

  5. Create bootable rescue CD with system configuration.

When a disaster occurrs, the recovery process consists of these actions:

Recovery Process

  1. Boot from the rescue media.

  2. Restore the disk layout (partitions, RAID configurations, LVM, file systems).

  3. Restore system and user data.

  4. Restore boot loader.

  5. Reboot system.

19.2. Preparing for the Worst Scenarios: Disaster Recovery Plans

Before the worst scenario happens, take actions to prepare with a disaster recovery plan. A disaster recovery plan is a document where all risks, infrastructure, and the budget is being collected. Maybe you have already some plan in place, but here is the general overview:

  • Risk Analysis.  Conduct a solid risk analysis of your infrastructure. List all the possible threats and evaluate how serious they are. Determine how likely these threats are and prioritize them. It is recommended to use a simple categorization: probability and impact.

  • Budget Planing.  The outcome of the analysis is an overview, which risks can be tolerated and which are critical for your business. Ask yourself, how can you minimize risks and how much will it cost. Depending on how big your company is, spend two to fifteen percent of the overall IT budget on disaster recovery.

  • Disaster Recovery Plan Development.  Make checklists, test procedures, establish and assign priorities, and inventory your IT infrastructure. Define how to deal with a problem when some services in your infrastructure fail.

  • Test.  After defining an elaborate plan, test it. Test it at least once a year. Use the same testing hardware as your main IT infrastructure.

19.3. Setting Up ReaR

ReaR supports some backup tools (Tivoli Storage Manager, QNetix Galaxy, Symantec NetBackup, HP DataProtector) and can output its rescue medium to a CD or PXE environment. The restore step is possible through NFS or CIFS and other network file systems. Find more information in the man page of ReaR (man rear).

To use ReaR you need at least two identical systems: the main machine where your productive environment is stored and the test machine. Identical in this context means, for example, you can replace a network card with another one using the same Kernel driver. If a hardware component does not use the same driver, it is not considered identical by ReaR.

ReaR can be used in different scenarios. The following example uses a NFS server as backup storage:

Procedure 19.1. Storing Your Backup on a NFS Server

  1. Set up a NFS server with YaST as described in Sharing File Systems with NFS from http://www.suse.com/doc/sles11/book_sle_admin/data/cha_nfs.html.

  2. Adapt the configuration file(s). Depending on how many servers you want to recover, use /etc/rear/site.conf for site-wide settings and /etc/rear/local.conf for machine-local settings. The following example uses a /etc/rear/local.conf configuration file. Replace the NETFS_URL with your own values. Further options are listed in the Various Settings section of the documentation at http://rear.github.com/documentation/.

    # Create ReaR rescue media as ISO image:
    OUTPUT=ISO
    # Store the backup file via NFS:
    BACKUP=NETFS
    # Only a NETFS_URL of the form 'nfs://host/path' is supported
    # so that 'mount -o nolock -t nfs host:/path' works.
    NETFS_URL=nfs://192.168.1.1/nfs/rear/
    # Keep an older copy of the backup in a HOSTNAME.old directory
    # provided there is no '.lockfile' in the HOSTNAME directory:
    NETFS_KEEP_OLD_BACKUP_COPY=yes

    If your NFS host is not an IP address but a hostname, DNS must work when the backup is restored.

  3. Prepare the backup by running:

    rear mkbackup

To perform a disaster recovery on your test machine, proceed as follows:

Procedure 19.2. Perform Disaster Recovery on Test Machine

  1. Locate the recovery ISO image stored as /tmp/rear-HOSTNAME.iso and burn it on CD.

  2. Boot your test machine with the recovery CD.

  3. Enter rear at the boot prompt.

  4. Log in as root (no password needed).

  5. Enter rear recover to start the recovery process. The recovery process installs and configures the machine and retrieves the backup data from your NFS server.

After this procedure, make sure the test machine is correctly set up and can serve as a replacement for your main machine. Test this procedure on a regular basis to ensure everything works as expected. Keep copies of the rescue CD iso, in case the media is damaged.

19.4. Using the YaST ReaR Module

The YaST ReaR module can be used to start with a basic setup. ReaR saves the recovery image and data on an NFS backend or a USB stick. However, the YaST ReaR module does not support recovery from a disaster. This requires some expertise and has to be done manually by the administrator.

To start with a basic setup, proceed as follows:

  1. Decide how to start your recovery system. Choose USB if you want to boot from a USB stick or ISO for CD-ROM respectively.

  2. Decide where the backup should be stored. Either select NFS or USB:

    • Select NFS if you have to use a server that offers Network File System. Specify the location as nfs://hostname/directory.

    • Select USB if you want to store your data on a USB stick. If no USB devices are shown, attach a USB stick or a USB disk and click Rescan USB Devices.

  3. If you want a previous backup copy to be saved, check Keep old backup.

  4. If you want to add additional directories that should also be included in your backup, use the Advanced menu and select Additional Directories in Backup.

  5. In case your rescue system does not boot due to missing Kernel modules, use the Advanced menu, select Additional Kernel Modules in Rescue System, and add the respective Kernel modules into the list of added modules for your rescue system.

  6. Click the Save and run rear now button to start the backup process.

After the YaST ReaR module is finished with the backup, test your backup to make sure it works as expected.

19.5. Setting Up rear-SUSE with AutoYaST

With the package rear-SUSE, the recovery process uses AutoYaST together with a ReaR backup, which is stored on a NFS server. Before you use it, check your disk space, you need at least 5 GB and up to 15 GB. The size is the sum of the following:

  • The SUSE installation medium (size of 5 GB DVD)

  • A working directory copied from the SUSE installation medium. The working copy is used by rear-SUSE for preparing the recovery ISO image.

  • Recovery ISO image. From 500 MB up to 5 GB.

Depending on your situation, you can limit the overall size. Refer to the rear-SUSE documentation for details in /usr/share/doc/packages/rear-SUSE/README.

[Note]Support of File Systems

AutoYaST can only recover file systems which are supported by YaST. Some file systems, like OCFS2, are currently not supported.

The following procedure creates a full recovery ISO image. This means, it downloads the SUSE installation medium, creates a full backup, and generates the recovery ISO image. Proceed as follows:

Procedure 19.3. Creating a Full Recovery Image

  1. Get the IP or hostname of your NFS server where your ReaR backup will be stored. If you do not have one, set up as described in Sharing File Systems with NFS .

  2. Proceed with the backup as described in Procedure 19.1, “Storing Your Backup on a NFS Server”, but use the command rear mkbackuponly to prepare the backup. You do not need to burn the CD.

  3. Start the backup, and replace BASE_DIR with your working directory (for example, /var/tmp/rear-SUSE/), and MEDIUM_URI (for example, http://server/path/medium.iso):

    RecoveryImage -c configure-all -d BASE_DIR \
      -l log-to-base-dir \
      -b make-rear-backup \
      -a clone-system \
      -i install-RPMs \
      -r restore-all \
      -m MEDIUM_URI

    This will start the backup process and store your data on your NFS server. After the backup process, the recovery ISO image is created.

  4. Burn the recovery ISO image on a DVD. Find the image in your BASE_DIR path with the name RecoverImage.DATE.iso.

After the DVD has been burnt, test your disaster recovery with another server using the same hardware. For example, identical hardware is a hard disk with the same disk geometry, or a network card which uses the same Kernel driver.

Procedure 19.4. Recovering with the Recovery Image

  1. Boot your test machine with the recovery image from Procedure 19.3, “Creating a Full Recovery Image” of Step 4.

  2. Enter autorecover at the boot prompt. The recovery image boots and starts the AutoYaST installation process.

  3. Follow the instructions on the screen. Any error messages regarding the packages rear or rear-SUSE can be ignored.

After the recovery, make sure the test machine functions properly and all data has been restored correctly from your NFS backup.

19.6. For More Information


SUSE Linux Enterprise High Availability Extension High Availability Guide 11 SP3