|Index|Preparing a System for Disaster Recovery with ReaR
SUSE Linux Enterprise High Availability 16.0

Preparing a System for Disaster Recovery with ReaR

Publication Date: 05 Nov 2026

ReaR (Relax-and-Recover) is a disaster recovery framework that helps system administrators re-create Linux infrastructure after a system failure. Using ReaR, you can create a bootable recovery system that re-creates the failed system's storage layout, restores files from a backup, and reinstalls the boot loader. To recover from a disaster as quickly as possible, prepare a disaster recovery system before the disaster happens and test it regularly on identical test hardware.

Prerequisites

  • Two systems: the machine to back up and an identical test machine. “Identical” in this context means that you can, for example, replace a network card with another one using the same kernel driver.

  • An internal backup tool, such as tar, or a supported third-party backup tool.

1 What is ReaR?

ReaR (Relax-and-Recover) is a disaster recovery framework designed to help system administrators re-create Linux infrastructure after a system failure. Using ReaR, you can create a bootable recovery system that re-creates the failed system's storage layout and restores files from a backup.

1.1 What is disaster recovery?

A system in a production environment might be destroyed unexpectedly because of broken hardware, misconfiguration or software problems. Disaster recovery means re-creating the system, either on the same hardware or on identical replacement hardware. Re-creating a system involves not just restoring the system's files from a backup, but also preparing the system's storage layout (such as partitioning, file systems and mount points) and reinstalling the boot loader.

No disaster recovery solution works out-of-the-box. Therefore, you must prepare for a disaster before it happens.

1.2 What is a disaster recovery plan?

Before a disaster happens, create a disaster recovery plan so that any system administrator knows exactly what to do and has a complete procedure to follow when the disaster happens.

Risk analysis

Conduct a risk analysis of your infrastructure. List all the possible threats and evaluate how serious they are. Determine how likely these threats are and what their impact would be.

Budget planning

The outcome of the analysis is an overview of which risks can be tolerated and which would be critical. Determine how you can minimize these risks and how much it costs to do so.

Disaster recovery planning

Make checklists, test procedures, establish and assign priorities, and inventory your IT infrastructure. Define how to deal with problems if any services in your infrastructure fail.

Disaster recovery testing

After defining a plan, test it thoroughly and regularly on hardware that is identical to your main IT infrastructure.

1.3 How does disaster recovery with ReaR work?

ReaR uses Bash scripts to analyze a running system and create a disaster recovery system, which includes a recovery installer and either an integrated or external file backup. You must configure ReaR for your specific system and infrastructure, including what to back up, how to create and store the recovery system, and what the recovery installer does.

For the file backup, ReaR can use internal backup tools, such as tar or rsync, or work with third-party backup tools. For a full list of supported file backup methods, run man rear.

If the system is destroyed, you can boot the recovery installer from a physical medium or over the network. The recovery installer re-creates the system by preparing the storage layout (such as partitioning, file systems and mount points), restoring the files from the backup, and reinstalling the boot loader.

Test your disaster recovery system regularly to make sure it still works as expected. In particular, you should re-validate your disaster recovery system in the following cases:

  • When you upgrade your operating system to a new major or minor version.

  • When you update ReaR to a new version.

  • When you update any software that ReaR uses.

  • When you update low-level system components, such as parted or btrfs.

If a test fails, you might need to update the ReaR configuration and re-create the disaster recovery system.

1.4 Can I update ReaR?

Version updates for ReaR are released in separate packages that intentionally conflict with each other. This prevents the installed version from being accidentally replaced with another version. If you have a tested and fully functional disaster recovery system with one version of ReaR, we recommend staying on that version.

However, if you do need to update ReaR, you can see which versions are available on the current version of your operating system by running the following command:

# zypper search --type package --verbose rear

You can find information about bug fixes, incompatibilities and other issues in the changelogs of the packages.

1.5 For more information

2 Installing ReaR

Install ReaR on the system you want to back up:

  1. Log in as the root user.

  2. Install ReaR:

    • To install the latest version of ReaR, run the following command:

      # zypper install rear
    • If you need to install a specific version of ReaR, you can specify the package version. For example:

      # zypper install rear29a
  3. If your system boots with a UEFI boot loader, make sure the xorriso package is installed:

    # zypper install xorriso

    This helper tool is used to create a UEFI-bootable ReaR recovery system ISO image.

3 Configuring ReaR

To configure ReaR, edit the /etc/rear/local.conf file to define your specific requirements, such as how to back up files and how to create and store the disaster recovery system. This configuration is sufficient for most systems. To re-create a non-standard system, you might also need to adjust the ReaR framework by editing the Bash scripts in /usr/share/rear/.

Warning
Warning: Btrfs limitations

Btrfs snapshot subvolumes can't be backed up and restored in their original state with file-based backup software.

Snapshot subvolumes on Btrfs file systems need almost no disk space because of Btrfs's copy-on-write functionality. However, file-based backup software backs up the snapshots as complete files, so they are included in the backup twice with their original file size. Therefore, the backed-up snapshots can't be restored to their original state.

Prerequisites
  • ReaR is installed on the system you want to back up.

  • If your system boots with a UEFI boot loader, make sure the xorriso package is installed.

Perform this procedure on the system you want to back up:

  1. Log in as the root user.

  2. Copy the closest matching SUSE Linux example from the /usr/share/rear/conf/examples/ directory and paste it into /etc/rear/local.conf. Use this example as a starting point and adjust it for your specific system.

    Important

    Currently, the latest example file is SLE12-SP2-btrfs-example.conf.

    All ReaR variables and their default values are explained in /usr/share/rear/conf/default.conf. Examples of important variables are shown in the next steps:

  3. Configure your file backup method with BACKUP and where to store the backup with BACKUP_URL. Use the following resources to learn more about configuring your backup method:

    • For a list of supported BACKUP methods, see man rear, section DESCRIPTION.

    • For more information about BACKUP_URL, see man rear, section BACKUP SOFTWARE INTEGRATION.

    • For more information about the additional options for each backup method, see the /usr/share/rear/conf/default.conf file.

    The following examples show some possible options:

    Example 1: Using an NFS server to store the file backup

    Make sure the backup directory on the NFS server has the right mount options. For example, you might need no_root_squash because the rear mkbackup command runs as root. For more information, see man exports.

    Configure ReaR to send the file backup to the NFS server:

    BACKUP=NETFS
    BACKUP_URL=nfs://HOST.EXAMPLE.COM/PATH/TO/REAR/BACKUP
    Example 2: Backing up Btrfs subvolumes with tar

    Btrfs is set up with subvolumes, but tar creates backups with the --one-file-system option, which excludes subvolumes. Therefore, the mount points for the subvolumes must be explicitly included in the ReaR configuration. For example:

    BACKUP=NETFS
    BACKUP_URL=nfs://HOST.EXAMPLE.COM/PATH/TO/REAR/BACKUP
    BACKUP_PROG_INCLUDE=( /boot/grub2/i386-pc /boot/grub2/x86_64-efi /home /opt /root /srv /usr/local /var )
    Tip
    Tip: Mount points for BACKUP_PROG_INCLUDE

    You can find the mount points for the subvolumes on your specific system by running the following command:

    # findmnt -n -r -o TARGET -t btrfs | grep -v '^/$' | egrep -v 'snapshots|crash'
  4. Configure the boot method for the recovery system with OUTPUT and, if necessary, where to store the recovery system with OUTPUT_URL. If you don't specify an OUTPUT_URL, ReaR stores the recovery system at the location defined by the BACKUP_URL. Use the following resources to learn more about configuring your boot method:

    • For more information about OUTPUT and OUTPUT_URL, see man rear, section RESCUE IMAGE CONFIGURATION.

    • For more information about the additional options for each boot method, see the /usr/share/rear/conf/default.conf file.

    The following examples show some possible options:

    Example 3: Including the file backup in an ISO image

    To save both the recovery system and the file backup to the same ISO image, you must use both BACKUP_URL and OUTPUT_URL:

    OUTPUT=ISO
    BACKUP_URL=iso:///backup/
    OUTPUT_URL=nfs://HOST.EXAMPLE.COM/PATH/TO/REAR/BACKUP
    Example 4: Creating a UEFI-bootable ISO image

    If your system boots with a UEFI boot loader, you must configure ReaR to use xorriso to create a UEFI-bootable ISO image:

    OUTPUT=ISO
    ISO_MKISOFS_BIN="/usr/bin/xorrisofs"

    If your system boots with UEFI Secure Boot, you must also add the following line:

    SECURE_BOOT_BOOTLOADER="/boot/efi/EFI/sles/shim.efi"
    Example 5: Saving the recovery system to a USB device

    To use a USB device as the output, run the following command to format the device and label it REAR-000:

    # rear format /PATH/TO/DEVICE

    Configure ReaR to save the recovery system to a bootable USB device:

    OUTPUT=USB
    BACKUP_URL=usb:///dev/disk/by-label/REAR-000
  5. In SUSE Linux 16, /etc/snapper/config-templates moved to /usr/share/snapper/config-templates. Change the COPY_AS_IS line to use the new file path:

    COPY_AS_IS+=( /usr/lib/snapper/installation-helper /usr/share/snapper/config-templates )
  6. If you have file systems on multipath devices, ReaR ignores them by default because it assumes they're on remote storage, not part of the local system. Add the following line to make ReaR include these file systems:

    AUTOEXCLUDE_MULTIPATH=n
  7. (Optional) If necessary, adjust the ReaR Bash scripts for your system's requirements.

  8. Review the ReaR configuration:

    # rear dump

    This command prints your ReaR configuration, taken from the default settings in /usr/share/rear/conf/default.conf and your specific settings in /etc/rear/local.conf.

4 Creating the recovery system

Generate a ReaR recovery system. The recovery system includes a system-specific recovery installer and might include an internal file backup or reference an external file backup, depending on your backup solution.

Important
Important: Using debugscript mode might log secrets

This procedure uses debugscript mode to provide the most debugging information, including logging commands and arguments in the ReaR log file. However, be aware that secrets and sensitive information might also be logged. Make sure you remove or obscure this information before sharing the log file.

Prerequisites
  • ReaR is installed on the system you want to back up.

  • ReaR is configured in /etc/rear/local.conf.

  • If ReaR is configured to use an external storage medium like a USB device, make sure the device is available on the system you want to back up.

  • If your system boots with a UEFI boot loader, make sure the xorriso package is installed.

Perform this procedure on the system you want to back up:

  1. Log in as the root user.

  2. Create the recovery system, using the -D option to enable debugscript mode:

    • For basic backups with tar, use the rear mkbackup command to create both the file backup and the recovery system:

      # rear -D mkbackup
    • For third-party backup tools, use the rear mkrescue command to create only the recovery system:

      # rear -D mkrescue

    Both commands perform the following steps:

    • Analyze the system and gather information, particularly about the boot loader and the disk layout, including partitioning, file systems, mount points, etc.

    • Create a bootable recovery system with the information gathered in the analysis.

    The rear mkbackup command also calls the internal backup tool to back up system files and user files. The rear mkrescue command doesn't create a backup of the files.

  3. If you used rear mkrescue, create a file backup using your third-party backup tool.

If the command fails, find the issue by reviewing the command output and the log file at /var/log/rear/. You might need to install a package or adjust the ReaR configuration.

5 Testing the recovery system

Whenever you create a disaster recovery system with ReaR, you must test it thoroughly on a test machine. The test machine must be able to serve as an identical replacement for the original machine if needed. We recommend testing the recovery system regularly to ensure everything works as expected.

Prerequisites

Perform this procedure on the test machine:

  1. Boot the test machine from the recovery medium.

  2. From the menu, select Relax-and-Recover.

  3. Log in as root. No password is needed.

  4. Start the recovery installer, using the -D option to enable debugscript mode:

    # rear -D recover

    This command performs the following steps:

    • Restores the disk layout, including partitions, file systems and mount points.

    • Restores the system files and user files from the backup.

    • Restores the boot loader.

    Important
    Important: Using debugscript mode might log secrets

    Using debugscript mode provides the most debugging information, including logging commands and arguments in the ReaR log file. However, secrets and sensitive information might also be logged. Make sure you remove or obscure this information before sharing the log file.

  5. After the recovery process is finished, reboot the system:

    # reboot
  6. Log in to the restored system with the original credentials. Check whether the system was successfully re-created and can serve as a replacement for the original machine in the production environment.

  7. When the test is finished, wipe the test storage so that it's ready for the next test or a disaster. Wiping a storage device can take a long time, so we recommend having clean replacement storage ready before a disaster happens so that you can recover as quickly as possible.

If the test fails, you might need to update the ReaR configuration and re-create the disaster recovery system.

6 Recovering from disaster

After a disaster occurs, boot the ReaR recovery system and start the recovery installer on a machine with identical hardware to the original machine. The following procedure refers to this new machine as the replacement machine. Technically, the replacement machine could be a tested, identical machine that replaces the original machine, or it could be the original machine after replacing any broken hardware.

Prerequisites

Perform this procedure on the replacement machine:

  1. If necessary, replace any broken hardware.

  2. Boot the replacement machine from the recovery medium.

  3. From the menu, select Relax-and-Recover.

  4. Log in as root. No password is needed.

  5. Start the recovery installer, using the -D option to enable debugscript mode:

    # rear -D recover

    This command performs the following steps:

    • Restores the disk layout, including partitions, file systems and mount points.

    • Restores the system files and user files from the backup.

    • Restores the boot loader.

    Important
    Important: Using debugscript mode might log secrets

    Using debugscript mode provides the most debugging information, including logging commands and arguments in the ReaR log file. However, secrets and sensitive information might also be logged. Make sure you remove or obscure this information before sharing the log file.

  6. After the recovery process is finished, reboot the system:

    # reboot
  7. Log in to the restored system with the original credentials. Check whether the system was successfully re-created and can serve as a replacement for the original machine in the production environment.

  8. If the checks are successful, add the replacement machine back to the production environment.