- Tumbleweed 2.9-1.1
- Leap-16.0
| REAR(8) | REAR(8) |
NAME¶
rear - bare metal disaster recovery and system migration tool
SYNOPSIS¶
rear [-h|--help] [-V|--version] [-dsSv] [-D|--debugscripts SET] [-c DIR] [-C CONFIG] [-r KERNEL] [-n|--non-interactive] [-e|--expose-secrets] [--] COMMAND [ARGS...]
DESCRIPTION¶
Relax-and-Recover (abbreviated ReaR) is the de facto standard disaster recovery framework on Linux.
It is in particular used on enterprise Linux distributions like Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES).
ReaR is a system administrator tool and framework to create a bootable disaster recovery system image for bare metal disaster recovery with data backup restore on physical or virtual replacement hardware.
For bare metal disaster recovery the ReaR recovery system is booted on pristine replacement hardware. On replacement hardware first the storage setup/layout is recreated (disk partitioning, filesystems, mount points), then a backup restore program is called to restore the data (system files) into the recreated storage, and finally a boot loader is installed.
System administrators use the ReaR framework to set up a disaster recovery procedure as part of their disaster recovery policy (which complements their existing backup policy).
ReaR complements backup and restore of data with bare metal disaster recovery. ReaR can also act as local backup software, but ReaR is not a a backup management software. In many enterprise environmentments, data backup and restore happens via dedicated backup software which is integrated by ReaR and used to restore the data onto a replacement system as part of the automated disaster recovery procedure implemented by ReaR.
ReaR has support for built-in backup methods using 'tar' and 'rsync' that are used for backup and restore.
ReaR integrates supports the following 3rd party, also commercial, tools for restoring a backup.
The complete list of backup methods (BACKUP=...) is:
ReaR integrates well with Disaster Recovery Linux Manager (DRLM, see <https://drlm.org>), which can act as a central management tool for ReaR deployments.
Professional services and support are available, see <https://relax-and-recover.org/support/>
OPTIONS¶
GLOBAL OPTIONS¶
-h --help
-c DIR
-C CONFIG
-d
-D
--debugscripts SET
-r KERNEL
-s
-S
-v
-n --non-interactive
-e --expose-secrets
-p --portable
-V --version
COMMANDS¶
checklayout
dump
format
help
mkbackup
mkbackuponly
mkrescue
mountonly
recover
restoreonly
mkopalpba
opaladmin
validate
Use 'rear -v help' for more advanced commands.
BACKGROUND INFORMATION¶
The process of bare metal disaster recovery consists of two parts:
Most backup software solutions are very good at restoring data but do not support recreating the system layout. Relax-and-Recover is very good at recreating the system layout but works best when used together with supported backup software.
In this combination Relax-and-Recover recreates the system layout and calls the backup software to restore the actual data. Thus there is no unnecessary duplicate data storage and the Relax-and-Recover rescue media can be very small.
For demonstration and special use purposes Relax-and-Recover also includes an internal backup method, NETFS, which can be used to create a simple tar.gz archive of the system. For all permanent setups we recommend using something more professional for backup, either a traditional backup software (open source or commercial) or rsync with hardlink based solutions, e.g. RSYNC BACKUP MADE EASY.
RESCUE IMAGE CONFIGURATION¶
The OUTPUT variable defines from where our bootable rescue image will be booted and the OUTPUT_URL variable defines where the rescue image should be send to. Possible OUTPUT settings are:
OUTPUT=RAMDISK
OUTPUT=ISO
OUTPUT=PXE
OUTPUT=OBDR
OUTPUT=USB
OUTPUT=RAWDISK
OUTPUT=PORTABLE
When using OUTPUT=ISO, RAMDISK, OBDR, USB, PORTABLE or RAWDISK you should provide the backup target location through the OUTPUT_URL variable. Possible OUTPUT_URL settings are:
OUTPUT_URL=file://
OUTPUT_URL=nfs://
OUTPUT_URL=cifs://
OUTPUT_URL=fish://
OUTPUT_URL=ftp://
OUTPUT_URL=ftps://
OUTPUT_URL=hftp://
OUTPUT_URL=http://
OUTPUT_URL=https://
OUTPUT_URL=sftp://
OUTPUT_URL=rsync://
OUTPUT_URL=sshfs://
OUTPUT_URL=null
If you do not specify OUTPUT_URL variable then by default it will be aligned to what was defined by variable BACKUP_URL. And, the rescue image will then be copied to the same location as your backup of the system disk(s).
The ISO_DEFAULT variable defines what default boot option is used on the rescue image. Possible values are manual, boothd or automatic. Manual will make you boot into the shell directly by default, boothd will boot to the first disk (default) or automatic will automatically start in recovery mode.
RESCUE IMAGE KERNEL COMMAND LINE OPTIONS¶
When booting the rescue image you can edit the kernel command line. There are some Relax-and-Recover specific kernel command line options:
debug
auto_recover or automatic
unattended
ip= nm= netdev= gw=
ip=192.168.100.2 nm=255.255.255.0 netdev=eth0 gw=192.168.100.1
noip
BACKUP SOFTWARE INTEGRATION¶
Currently Relax-and-Recover supports the below listed backup methods.
There is a distinction between Relax-and-Recover support for 3rd party backup software and Relax-and-Recover built-in backup methods. The latter also creates a backup of your data while the former will only integrate Relax-and-Recover with the backup software to restore the data with the help of the backup software without actually creating backups. This means that for all non-built-in backup software you must take care of creating backups yourself (unless otherwise noted).
Especially the rear mkbackup command can be confusing as it is only useful for the built-in backup methods and has usually no function at all with the other (3rd party / external) backup methods where the rear mkrescue command applies.
See the full list of supported backup methods above for reference and consult '/usr/share/rear/conf/default.conf' for the full list of supported options for each backup method. Also, 'rear dump' will show you the current settings for BACKUP and OUTPUT methods including all available options.
The default BACKUP method is REQUESTRESTORE which is not a backup method at all but simply halts the recovery and requests that somebody will restore the data to the appropriate location (e.g. via SSH). This method works especially well with an rsync based backup that is pushed back to the backup client.
If your favourite backup software is missing from this list, please submit a patch or ask us to implement it for you.
When using BACKUP=NETFS you must provide the backup target location through the BACKUP_URL variable. Possible BACKUP_URL settings are:
BACKUP_URL=file://
BACKUP_URL=nfs://
BACKUP_URL=tape://
BACKUP_URL=rsync://
BACKUP_URL=rsync://[user@]host[:port]/path BACKUP_URL=rsync://[user@]host[:port]::/path
BACKUP_URL=cifs://
username=_username_ password=_secret password_ domain=_domain_
BACKUP_URL=usb://
If you combine this with OUTPUT=USB you will end up with a bootable USB device.
BACKUP_URL=sshfs://
It is advisable to add ServerAliveInterval 15 in the /root/.ssh/config file for the remote system (remote-system.name.org).
BACKUP_URL=iso://
BACKUP_URL=iso:///backup/ OUTPUT_URL=nfs://server/path/
When using BACKUP=NETFS and BACKUP_PROG=tar there is an option to select BACKUP_TYPE=incremental or BACKUP_TYPE=differential to let rear make incremental or differential backups until the next full backup day e.g. via FULLBACKUPDAY="Mon" is reached or when the last full backup is too old after FULLBACKUP_OUTDATED_DAYS has passed. Incremental or differential backup is currently only known to work with BACKUP_URL=nfs. Other BACKUP_URL schemes may work but at least BACKUP_URL=usb requires USB_SUFFIX to be set to work with incremental or differential backup.
SUPPORT FOR SELF-ENCRYPTING DISKS¶
Relax-and-Recover supports self-encrypting disks (SEDs) compliant with the TCG Opal 2 specification if the sedutil-cli executable is installed.
Self-encrypting disk support includes
To prepare booting from an SED, run rear mkopalpba, then create the rescue system.
To set up an SED, boot the Relax-and-Recover rescue system and run rear opaladmin setupERASE DEVICE (DEVICE being the disk device path like /dev/sda).
For complete information, consult the section "Support for TCG Opal 2-compliant Self-Encrypting Disks" in the Relax-and-Recover user guide.
CONFIGURATION¶
To configure Relax-and-Recover you have to edit the configuration files in /etc/rear/. All *.conf files there are part of the configuration, but only site.conf and local.conf are intended for the user configuration. All other configuration files hold defaults for various distributions and should not be changed.
In /etc/rear/templates/ there are also some template files which are used by Relax-and-Recover to create configuration files (mostly for the boot environment). Modify the templates to adjust the information contained in the emails produced by Relax-and-Recover. You can use these templates to prepend your own configurations to the configuration files created by Relax-and-Recover, for example you can edit PXE_pxelinux.cfg to add some general pxelinux configuration you use.
In almost all circumstances you have to configure two main settings and their parameters: The backup method and the output method.
The backup method defines, how your data is to be saved and whether Relax-and-Recover should backup your data as part of the mkbackup workflow for internal backup methods or whether you use 3rd party backup software to archive your data.
The output method defines how the rescue system is written to disk and how you plan to boot the failed computer from the rescue system.
See the default configuration file /usr/share/rear/conf/default.conf for an overview of the possible methods and their options.
An example to use TSM for backup and ISO for output would be to add these lines to /etc/rear/local.conf (no need to define a BACKUP_URL when using an external backup solution):
BACKUP=TSM OUTPUT=ISO
And if all your systems use NTP for time synchronisation, you can also add these lines to /etc/rear/site.conf
TIMESYNC=NTP
Do not forget to distribute the site.conf to all your systems.
The resulting ISO image will be created in /var/lib/rear/output/. You can now modify the behaviour by copying the appropriate configuration variables from default.conf to local.conf and changing them to suit your environment.
EXIT STATUS¶
0
>0
EXAMPLES¶
To print out the current settings for BACKUP and OUTPUT methods and some system information. This command can be used to see the supported features for the given release and platform.
# rear dump
To create a new rescue environment. Do not forget to copy the resulting rescue system away so that you can use it in the case of a system failure.
# rear -v mkrescue
To create a new rescue image together with a complete archive of your local system run the command:
# rear -v mkbackup
FILES¶
/usr/sbin/rear
/etc/rear/local.conf
/etc/rear/site.conf
/var/log/rear/
/tmp/rear.####
/usr/share/rear
/usr/share/rear/conf/default.conf
BUGS¶
Feedback is welcome, please report issues or improvements to our issue-tracker at: <http://github.com/rear/issues/>
Furthermore, we welcome pull requests via GitHub.
SEE ALSO¶
Relax-and-Recover comes with extensive documentation located in /usr/share/doc.
AUTHORS¶
The ReaR project was initiated in 2006 by Schlomo Schapiro ( <https://github.com/schlomo>) and Gratien D’haese ( <https://github.com/gdha>) and has since then seen a lot of contributions by many authors. As ReaR deals with bare metal disaster recovery, there is a large amount of code that was contributed by owners and users of specialized hardware and software. Without their combined efforts and contributions ReaR would not be the universal Linux bare metal disaster recovery solution that it is today.
As time passed the project was lucky to get the support of additional developers to also help as maintainers: Dag Wieers ( <https://github.com/dagwieers>), Jeroen Hoekx ( <https://github.com/jhoekx>), Johannes Meixner ( <https://github.com/jsmeix>), Vladimir Gozora ( <https://github.com/gozora>), Sebastien Chabrolles ( <https://github.com/schabrolles>), Renaud Metrich ( <https://github.com/rmetrich>) and Pavel Cahyna ( <https://github.com/pcahyna>). We hope that ReaR continues to prove useful and to attract more developers who agree to be maintainers. Refer to the MAINTAINERS ( <https://github.com/rear/rear/blob/master/MAINTAINERS>) file for the list of active and past maintainers.
To see the full list of authors and their contributions look at the git history ( <https://github.com/rear/rear/graphs/contributors>). We are very thankful to all authors and encourage anybody interested to take a look at our source code and to contribute what you find important.
Relax-and-Recover is a developed with a collaborative process using Github at <http://github.com/rear/>
The Relax-and-Recover website is located at: <http://relax-and-recover.org/>
COPYRIGHT¶
(c) 2006-2022
The copyright is held by the original authors of the respective code pieces as can be seen in the git history at <https://github.com/rear/rear/graphs/contributors>
Relax-and-Recover comes with ABSOLUTELY NO WARRANTY; for details see the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
| 2024-12-17 |