Home / Linux / and-Recover – Backup and Recover a Linux System

and-Recover – Backup and Recover a Linux System

and-Recover – Backup and Recover a Linux System

Relax-and-Recover (ReaR briefly) is a easy but highly effective, straightforward-to-setup, full-featured and main open-supply naked metallic catastrophe restoration and system migration resolution, written in Bash. It is a modular and configurable framework with quite a few prepared-to-use workflows for widespread conditions.

ReaR creates a bootable rescue system and/or system backup in varied codecs. You can boot your naked metallic server utilizing the rescue system picture and provoke a system restore from the backup. It can restore to totally different hardware the place obligatory, therefore it can be employed as a system migration device.

Relax-and-Recover Key Features:

  1. It has a modular design written in Bash and could be prolonged utilizing customized performance.
  2. Supports varied boot media together with ISO, PXE, OBDR tape, USB or eSATA storage.
  3. Supports a number of community protocols together with FTP, SFTP, HTTP, NFS, and CIFS for storage and backup.
  4. Supports disk format implementation resembling LVM, DRBD, iSCSI, HWRAID (HP SmartArray), SWRAID, multipathing, and LUKS (encrypted partitions and filesystems).
  5. Supports each third-social gathering and inner backup instruments together with IBM TSM, HP DataProtector, Symantec InternetBackup, Bacula; tar and rsync.
  6. Supports booting by way of PXE, DVD/CD, bootable tape or digital provisioning.
  7. Supports a simulation mannequin that exhibits what scripts are run with out executing them.
  8. Supports constant logging and superior debugging choices for troubleshooting functions.
  9. It could be built-in with monitoring instruments resembling Nagios and Opsview.
  10. It can be built-in with job schedulers resembling cron.
  11. It additionally helps varied virtualization applied sciences supported (KVM, Xen, VMware).

In this text, you’ll learn to set up and configure ReaR to create a rescue system and/or system backup utilizing a USB stick and rescue or restore a naked-metallic Linux system after a catastrophe.

Step 1: Installing ReaR in Linux Bare Metal Server

1. To set up the rear package deal on Debian and Ubuntu Linux distributions, use the next command.

$ sudo apt-get set up rear extlinux

On RHEL and CentOS, you’ll want to allow the EPEL eight repository, then set up the rear package deal as proven.

# yum set up rear syslinux-extlinux grub2-efi-x64-modules
# dnf set up rear syslinux-extlinux	#Fedora 22+

2. Once the set up is full, rear’s foremost configuration listing is /and so forth/rear/ and the important thing configuration information are:

  • /and so forth/rear/native.conf – used to set system-particular configuration; it’s meant for handbook configuration.
  • /and so forth/rear/website.conf – used to set website-particular configuration, needs to be created by the person.
  • /usr/share/rear/conf/default.conf – accommodates potential/default configuration values.
  • /var/log/rear/ – this listing shops the log information.

three. First, put together the rescue media, a USB stick on this case by formatting utilizing the rear command-line utility as follows. Once the formatting is full, the media shall be labeled as REAR-000.

# rear format /dev/sdb
Prepare Rescue MediaPrepare Rescue Media

Prepare Rescue Media

four. To configure the output format, use the OUTPUT and OUTPUT_URL variables, enter it within the /and so forth/rear/native.conf configuration file.


four. Also, ReaR comes with a constructed-in backup methodology (referred to as NETFS) which lets you create each a rescue system and a full-system backup. It creates a easy backup as a tar archive by default.

To allow a full-system backup, add the BACKUP=NETFS and BACKUP_URL variables within the /and so forth/rear/native.conf configuration file. To create a bootable USB system, mix OUTPUT=USB and BACKUP_URL=”usb:///dev/disk/by-label/REAR-000” as proven.


5. After configuring the rear, run the next command to print out its present configuration for BACKUP and OUTPUT strategies and some system info.

# rear dump
Rear Backup Configuration SettingsRear Backup Configuration Settings

Rear Backup Configuration Settings

Step 2: Creating a Rescue System and a Full-System Backup

6. If all of the settings are wonderful, you may create a rescue system utilizing the mkrecue command as follows, the place the -v choice allows verbose mode.

# rear -v  mkrescue
Make Rescue SystemMake Rescue System

Make Rescue System

Note: If you encounter the next error after operating a rescue or backup operation, as proven on this screenshot.

UEFI methods: “ERROR: /dev/disk/by-label/REAR-EFI is not block device. Use `rear format -- --efi ' for correct format” 
USB Stick Format ErrorUSB Stick Format Error

USB Stick Format Error

Format the USB stick utilizing this command and redo the operation.

# rear format  -- --efi /dev/sdb
Format USBFormat USB

Format USB

7. To create a rescue system and backup the system as effectively, use the mkbackup command as proven.

# rear -v mkbackup

eight. To create a full-system backup solely, use the mkbackuponly command as follows.

# rear -v mkbackuponly

Optional: Scheduling Rear Operations Using Cron

eight. You can schedule ReaR to frequently create a rescue system utilizing the cron job scheduler by including the suitable entry within the /and so forth/crontab file.

minute hour day_of_month month day_of_week root /usr/sbin/rear mkrescue

The following configurations will create a rescue system or take a full-system backup each midnight. Ensure that your USB stick is connected to it.

zero 		zero   		*  		* 		root /usr/sbin/rear mkrescue
zero 		zero   		*  		* 		root /usr/sbin/rear mkbackup

Step three: Performing a System Rescue/Restoration

9. To restore/recuperate your system after a catastrophe, join the bootable USB persist with your naked metallic system and boot from it. In the console interface, choose choice one (Recover hostname) and click on Enter.

ReaR Main Boot MenuReaR Main Boot Menu

ReaR Main Boot Menu

10. Next, the ReaR rescue system shall be configured, it’s possible you’ll be prompted to supply replacements for the unique community interfaces as proven within the screenshot. Once you’re accomplished, click on Enter.

Select Network InterfaceSelect Network Interface

Select Network Interface

11. Then login as root (simply kind username root and click on Enter) to run the precise restoration.

Run System RecoveryRun System Recovery

Run System Recovery

11. Next, run the next command to launch the restoration course of. The rescue system will examine the disks, look at their configurations and immediate you to decide on disk format configuration. Press Enter to proceed with auto disk configuration.

Then it’s going to begin the system format restoration, as soon as the disk format is created, it’s going to restore the backup as proven within the following screenshot.

# rear recuperate
ReaR Recover MethodReaR Recover Method

ReaR Recover Method

12. When the backup restoration is full, the rescue system will run mkinitrd to create preliminary ramdisk pictures for preloading modules, then set up the boot loader and exits. One the system restoration is completed, the restored system shall be mounted below /mnt/native/, transfer into this listing to look at it.

Finally, reboot the system:

# cd /mnt/native
# rebooot
Explore Restored SystemExplore Restored System

Explore Restored System

13. After a reboot, the SELinux will attempt to relabel information and file methods on the recovered system based mostly on /mnt/native/.autorelabel file, as proven within the following screenshot.

Relabeling File SystemRelabeling File System

Relabeling File System

For extra utilization choices, learn the ReaR handbook web page.

# man rear

ReaR Homepage: http://relax-and-recover.org/.

The ReaR is the main, straightforward-to-use (setup-and-neglect) and open supply naked metallic catastrophe restoration and system migration framework. In this text, we defined tips on how to use ReaR to create a Linux naked metallic rescue system and backup and tips on how to restore a system after a catastrophe. Use the remark kind beneath share your ideas with us.

About Agent

Check Also

SpaceX Successfully Launches 60 More Starlink Satellites as it Continues Towards 2020 Service Debut

SpaceX Successfully Launches 60 More Starlink Satellites as it Continues Towards 2020 Service Debut SpaceX …

Leave a Reply

Your email address will not be published. Required fields are marked *