Relax-and-Recover allows you to back up a Linux server by creating a bare-metal image of the system. This can be stored any number of places such as on the network, tape, USB, etc. It can also be used to migrate a Linux installation to another host.
ReaR is not for file-level recovery and cannot be used for that purpose. It is meant for disaster recovery but also allows for incremental backups to be done. For file-level backup and recovery, I recommend using FWBackups.
ReaR creates backups in a compressed TAR.GZ, and also creates a bootable recovery image (.iso) for each Linux server that is backed up. ReaR is able to integrate with other backup solutions such as Bacula, Bareos, etc.
Table of Contents
You may need to install the following packages:
dnf install syslinux syslinux-extlinux
Installing and Configuring ReaR
- On Fedora, install ReaR by entering the following command:
dnf install rear
- Create and edit the following file to match below: vi /etc/rear/site.conf
OUTPUT=ISO BACKUP=NETFS BACKUP_PROG=tar BACKUP_URL="nfs://<IP ADDRESS>/LinuxBackups/" BACKUP_TYPE=incremental FULLBACKUPDAY="Sun"
Creating a Backup
- Run the following command to create a backup of the Linux system as well as a bootable .iso for recovery:
rear -v mkbackup
Create a cronjob as root to run the command: rear mkbackup as often as you like.
0 6 * * 0 /usr/sbin/rear mkbackup
To recover a system, you first need to boot to the .ISO that was created with the backup. You may use your favorite method for booting to the .ISO whether it’s creating a bootable USB sick, burning it to a CD, mounting it in iDRAC, etc. Just boot to it on the server in which you want to restore to.
- When the recovery screen loads, select the top option to recover.
- Type root to log in.
- To start recovery, enter rear -v recover
- If recovery fails, see below.
THIS SECTION STILL IN PROGRESS
# Create missing directory:
# Manually start networking:
chmod a+x /etc/scripts/system-setup.d/60-network-devices.sh
# Navigate to and list files in /var/lib/rear/layout/xfs
# Edit each file ending in .xfs with vi and remove “sunit=0 blks” from the “log” section.
# In my case, the following files, then save them:
# Run the following commands to get a list of LVs and VGs:
# Run the following commands to remove the above listed LVs and VGs:
# Now run recovery again:
Configuration options: https://github.com/rear/rear/blob/master/doc/user-guide/03-configuration.adoc
Resolved recovery issue: https://github.com/rear/rear/issues/1575#issuecomment-344732487