REAR(8)
REAR(8) π β¨
πΈ NAME πΈ
rear β bare metal disaster recovery and system migration tool. That's the whole vibe, bestie. π
π¦ 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 π
Okay so Relax-and-Recover (abbreviated ReaR) is literally the de facto standard disaster recovery framework on Linux. No cap.
It's especially used on enterprise Linux distributions like Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES). Iconic.
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. The way that whole pipeline just works? obsessed.
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 backup management software. In many enterprise environments, 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 also integrates with and supports the following 3rd party, also commercial, tools for restoring a backup. Vibe check time:
The complete list of backup methods (BACKUP=...) is:
AVAβ Dell EMC Avamar / EMC AvamarBACULAβ BaculaBAREOSβ BareosBLOCKCLONEβ block device cloning viaddBORGβ Borg BackupCDMβ Rubrik Cloud Data ManagementDPβ OpenText Data ProtectorDUPLICITYβ Duplicity / DuplyEXTERNALβ External custom restore methodFDRUPSTREAMβ FDR/UpstreamGALAXY11β Commvault Galaxy 11 / Commvault SimpanaNBKDCβ NovaStor DataCenterNBUβ Veritas NetBackup / Symantec NetBackupNETFSβ ReaR built-in backup and restore viarsyncortarto a network file system or to a locally attached backup disk (USB, eSATA, ...)NFS4SERVERβ NFS4 server to push data to the rescue systemNSRβ Dell EMC NetWorker / EMC NetWorker / Legato NetWorkerOBDRβ One Button Disaster Recovery via tapePPDMβ Dell PowerProtect Data ManagerRBMEβ Rsync Backup Made EasyREQUESTRESTOREβ Request restore from a human operatorRSYNCβ ReaR built-in backup usingrsyncviarsyncorsshprotocolSESAMβ SEP SesamTSMβ IBM Storage Protect / Tivoli Storage Manager / IBM Spectrum ProtectVEEAMβ Veeam Backup
ReaR integrates well with Disaster Recovery Linux Manager (DRLM, see https://drlm.org), which can act as a central management tool for ReaR deployments. Central management? We love a main character.
Professional services and support are available, see https://relax-and-recover.org/support/
β¨ OPTIONS β¨
π GLOBAL OPTIONS π
-h,--helpβ usage information-c DIRβ alternative config directory instead of/etc/rear-C CONFIGβ additional config files (absolute path or relative to config directory)-dβ debug mode: run many commands verbosely with debug messages in the log file (also sets-v)-Dβ debugscript mode: log executed commands viaset -x(also sets-vand-d)--debugscripts SETβ same as-Dbut debugscript mode withset -SET-r KERNELβ kernel version to use (by default the version of the running kernel)-sβ simulation mode: show what scripts are run without executing them-Sβ step-by-step mode: acknowledge each script individually-vβ verbose mode: show messages what ReaR is doing on the terminal-n,--non-interactiveβ non-interactive mode: abort inUserInput()if default input does not make ReaR proceed (experimental)-e,--expose-secretsβ do not suppress output of confidential values (passwords, encryption keys) in particular in the log file-p,--portableβ allow running any ReaR workflow, especiallyrecover, from a git checkout or rear source archive-V,--versionβ version information
π COMMANDS π
checklayoutβ check if the disk layout has changed since the last run ofmkbackup/mkrescuedumpβ dump configuration and system information; run this to verify your setupformatβ format and label USB or tape media to be used withrear; first argument is the USB or tape device to use, eg./dev/sdXor/dev/stXhelpβ print full list of commands and optionsmkbackupβ create rescue media and backup the system (only for internal backup methods)mkbackuponlyβ backup the system (only for internal backup methods) without creating rescue mediamkrescueβ create rescue media onlymountonlyβ use ReaR as live media to mount and repair the systemrecoverβ recover the system; can be used only when running from the rescue mediarestoreonlyβ only restore the backup; can be used only when running from the rescue mediamkopalpbaβ create a pre-boot authentication (PBA) image to boot from TCG Opal 2-compliant self-encrypting disksopaladminβ administrate TCG Opal 2-compliant self-encrypting disksvalidateβ submit validation information
Use rear -v help for more advanced commands.
π§ BACKGROUND INFORMATION π§
The process of bare metal disaster recovery consists of two parts:
- Recreate the system layout
- Restore the data to the system
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. Like, complementary queen behavior.
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. Small rescue media, big slay.
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. iykyk.
π 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 sent to. Possible OUTPUT settings are:
OUTPUT=RAMDISKβ Create only the Relax-and-Recover initramfs.OUTPUT=ISOβ (Default) Create a bootable ISO9660 image on disk asrear-$(hostname).isoOUTPUT=PXEβ Create on a remote PXE/NFS server the required files (such as configuration file, kernel and initrd image)OUTPUT=OBDRβ Create a bootable OBDR tape (optionally including the backup archive). Specify the OBDR tape device by usingTAPE_DEVICE.OUTPUT=USBβ Create a bootable USB disk.OUTPUT=RAWDISKβ Create a bootable image file namedrear-$(hostname).raw.gz, which- supports UEFI boot if syslinux/EFI or Grub 2/EFI is installed,
- supports Legacy BIOS boot if syslinux is installed,
- supports UEFI/Legacy BIOS dual boot if syslinux and one of the supported EFI bootloaders are installed.
OUTPUT=PORTABLEβ Create a portable ReaR archive that can be used on any rescue system to run any ReaR workflow, especiallyrecover. Assumes that all required software is installed and usable there. This is experimental, please report any issues.
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://β Write the image to disk. The default is in/var/lib/rear/output/.OUTPUT_URL=nfs://β Write the image by mounting the target filesystem via NFS.OUTPUT_URL=cifs://β Write the image by mounting the target filesystem via CIFS.OUTPUT_URL=fish://β Write the image usinglftpand the FISH protocol.OUTPUT_URL=ftp://β Write the image usinglftpand the FTP protocol.OUTPUT_URL=ftps://β Write the image usinglftpand the FTPS protocol.OUTPUT_URL=hftp://β Write the image usinglftpand the HFTP protocol.OUTPUT_URL=http://β Write the image usinglftpand the HTTP (PUT) protocol.OUTPUT_URL=https://β Write the image usinglftpand the HTTPS (PUT) protocol.OUTPUT_URL=sftp://β Write the image usinglftpand the secure FTP (SFTP) protocol.OUTPUT_URL=rsync://β Write the image usingrsyncand the RSYNC protocol.OUTPUT_URL=sshfs://β Write the image usingsshfsand the SSH protocol.OUTPUT_URL=nullβ Do not copy the rescue image from/var/lib/rear/output/to a remote output location.OUTPUT_URL=nullis useful when another program (e.g. an external backup program) is used to save the rescue image from the local system to a remote place, or withBACKUP_URL=iso:///backupwhen the backup is included in the rescue image to avoid a (big) copy of the rescue image at a remote output location. In the latter case the rescue image must be manually saved from the local system to a remote place.OUTPUT_URL=nullis only supported together withBACKUP=NETFS.
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 β¨
Okay so when you boot the rescue image, you can actually edit the kernel command line π and there are some Relax-and-Recover specific options you can drop in there:
debugβ the rescue system start up scripts in/etc/scripts/system-setup.d/get run one by one, each one after you press Enter, and the scripts run withset -xwhich prints commands and their arguments as they are executed. So you literally see everything happen πauto_recoverorautomaticβ launchesrear recoverautomatically (without automated reboot). Ngl if you pair it withdebugit runsrear recoverin debugscript mode πunattendedβ launchesrear recoverautomatically as withauto_recoverplus automated reboot after successfulrear recover. Set it and forget it, bestie πip= nm= netdev= gw=β when IP address plus optionally netmask (default255.255.255.0), network device (defaulteth0), and default gateway are specified, then only that single network device is set up. Example:
ip=192.168.100.2 nm=255.255.255.0 netdev=eth0 gw=192.168.100.1
noipβ skip network devices setup by the rescue system start up scripts (overridesip= nm= netdev= gw=). Like, absolutely no networking bestie π«
π BACKUP SOFTWARE INTEGRATION π
Currently Relax-and-Recover supports the below listed backup methods. Iconic.
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. So basically: for all non-built-in backup software you must take care of creating backups yourself (unless otherwise noted). No cap, that part is on you π
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. Like, don't @ me when mkbackup does nothing with your external setup, that's just how it is π
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. Handy af π«Ά
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://β to backup to local disk, useBACKUP_URL=file:///directory/path/BACKUP_URL=nfs://β to backup to NFS disk, useBACKUP_URL=nfs://nfs-server-name/share/pathBACKUP_URL=tape://β to backup to tape device, useBACKUP_URL=tape:///dev/nst0or alternatively, simply defineTAPE_DEVICE=/dev/nst0BACKUP_URL=rsync://β when backup methodBACKUP=RSYNCis chosen then we need to define a correspondingBACKUP_URLrule:
BACKUP_URL=rsync://[user@]host[:port]/path
BACKUP_URL=rsync://[user@]host[:port]::/path
BACKUP_URL=cifs://β to backup to a Samba share (CIFS), useBACKUP_URL=cifs://cifs-server-name/share/path. To provide credentials for CIFS mounting use a/etc/rear/cifscredentials file and defineBACKUP_OPTIONS="cred=/etc/rear/cifs"and pass along:
username=_username_
password=_secret password_
domain=_domain_
BACKUP_URL=usb://β to backup to USB storage device, useBACKUP_URL=usb:///dev/disk/by-label/REAR-000or use a partition device node or a specific filesystem label. Alternatively, you may specify the partition device usingUSB_DEVICE=/dev/disk/by-label/REAR-000if needed.
If you combine this with OUTPUT=USB you will end up with a bootable USB device π₯
BACKUP_URL=sshfs://β to backup to a remote server via sshfs (SSH protocol), useBACKUP_URL=sshfs://user@remote-system.name.org/home/user/backup-dir/
It is advisable to add ServerAliveInterval 15 in the /root/.ssh/config file for the remote system (remote-system.name.org). Trust me, your connection will thank you π«
BACKUP_URL=iso://β to include the backup within the ISO image. It is important that theBACKUP_URLandOUTPUT_URLvariables are different. E.g.
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. So yeah, that's the fine print bestie πΈ
π¦ 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. Fancy, right? π
Self-encrypting disk support includes:
- recovery (saving and restoring the systemβs SED configuration),
- setting up SEDs, including assigning a disk password,
- providing a pre-boot authentication (PBA) system to unlock SEDs at boot time.
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). Yes, that word is literally setupERASE β bold naming tbh π
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. Leave those alone bestie, they're not for us π
ββοΈ
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. Cute little customization moment π
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. Like actually don't forget, that's the whole point of site config π«
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. Slay π
β EXIT STATUS β
0β successful program execution. We love a zero π>0β usage, syntax or execution errors. Check the log file in/var/log/rear/for more information. Something went sideways, go read the logs bestie π
π 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. Like, that's the entire point, don't skip this step π
# 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β the program itself./etc/rear/local.confβ system specific configuration can be set here./etc/rear/site.confβ site specific configuration can be set here (not created by default)./var/log/rear/β directory holding the log files./tmp/rear.####β Relax-and-Recover working directory. If Relax-and-Recover exits with an error, you must remove this directory manually. Yes, must β it won't clean itself up for you π§Ή/usr/share/rearβ Relax-and-Recover script components./usr/share/rear/conf/default.confβ Relax-and-Recover default values. Contains a complete set of parameters and its explanation. Do not edit or modify things therein but uselocal.conforsite.conffor specific settings. Hands off, it said what it said π
π 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. Come contribute, it's giving open source icon behaviour π«Ά
π§ SEE ALSO π§
Relax-and-Recover comes with extensive documentation located in /usr/share/doc.
π AUTHORS π
okay so bestie, gather round, because the lore here is genuinely iconic π«Ά
The ReaR project was initiated in 2006 by Schlomo Schapiro (https://github.com/schlomo) and Gratien Dβhaese (https://github.com/gdha), and since then it has seen a lot of contributions by many authors. And like β 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. No cap. 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 β the whole main character lineup β¨:
- 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) - 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 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 π
bestie, listen β Relax-and-Recover comes with ABSOLUTELY NO WARRANTY; for details see the GNU General Public License at http://www.gnu.org/licenses/gpl.html π it's giving "read the fine print" energy and honestly? deserved.
and that's the whole page, we're done, no crumbs left π this was the REAR(8) manual page, and it's stamped 2024-12-17 β go forth and back up your bare metal, mwah ππ
π¦ where this page comes from
- centos-stream 10: rear 2.9-6.el10 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: rear29a 2.9-160000.3.1 Β· GPL-2.0-or-later AND GPL-3.0-only
- opensuse-leap 16.0: rear29a 2.9-160000.3.1 Β· GPL-2.0-or-later AND GPL-3.0-only
- ubuntu resolute: rear 2.9+dfsg-3 Β· GPL-3.0-or-later
- ubuntu stonking: rear 2.9+dfsg-3 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms