Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the function of Linux system tool ReaR

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what functions Linux system tool ReaR has". In daily operation, I believe many people have doubts about what functions Linux system tool ReaR has. Xiaobian consulted all kinds of information and sorted out simple and easy to use operation methods. I hope to help you answer the doubts about "what functions Linux system tool ReaR has"! Next, please follow the small series to learn together!

Relax-and-Recover (ReaR) is a simple but powerful, easy-to-set, full-featured and leading open source bare-metal disaster recovery and systems migration solution written in Bash. It is a modular and configurable framework with a large number of out-of-the-box workflows for common situations.

ReaR creates bootable rescue systems and/or system backups in various formats. You can boot bare metal servers using emergency system images and initiate system restore from backups. It can be reverted to different hardware if necessary, so it can also be used as a system migration tool.

Relax-and-Recover main functions:

It has a modular design written in Bash and can be extended with custom features.

Supports a variety of boot media, including ISO, PXE, OBDR tape, USB or eSATA storage.

Supports multiple network protocols, including FTP, SFTP, HTTP, NFS, and CIFS for storage and backup.

Supports disk layout implementations such as LVM, DRBD, iSCSI, HWRAID (HP SmartArray), SWRAID, multipath, and LUKS (Encrypted Partitions and File Systems).

Support for third-party and internal backup tools, including IBM TSM, HP DataProtector, Symantec NetBackup, Bacula;tar, and rsync.

Support boot via PXE, DVD/CD, bootable tape or virtual provisioning.

Supports a simulation model that shows what scripts run without executing them.

Supports consistent logging and advanced debugging options for troubleshooting.

It can be integrated with monitoring tools such as Nagios and Opsview.

It can also be integrated with job schedulers such as cron.

It also supports various supported virtualization technologies (KVM, Xen, VMware).

In this article, you will learn how to install and configure ReaR to create emergency systems and/or system backups using USB sticks, as well as emergency or restore bare metal Linux systems after a disaster.

Step 1: Install ReaR in Linux Bare Metal Server

1. To install rear packages on Debian and Ubuntu Linux distributions, use the following command.

$ sudo apt-get install rear extlinux

On RHEL and CentOS, you need to enable the EPEL 8 repository and install the post-wrap as shown.

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

2. After installation, the main configuration directory at the rear is/etc/rear//, and the main configuration files are:

/etc/rear/local.conf-Used to set system-specific configuration; used for manual configuration.

/etc/rear/site.conf-Used to set site-specific configurations, created by the user.

/usr/share/rear/conf/default.conf-Contains possible/default configuration values.

/var/log/rear/-This directory stores log files.

3. First, prepare emergency media (in this case a USB stick) by formatting it using the rear command-line utility as follows. After formatting is complete, the media will be labeled REAR-000.

# rear format /dev/sdb

4. To configure the output format, use the OUTPUT and OUTPUT_URLL variables and enter them into the/etc/rear/local.conf configuration file.

OUTPUT=USB

5. In addition, ReaR comes with a built-in backup method called NETFS that lets you create backups of rescue systems and entire systems. By default, it creates a simple backup as tar archive.

To enable full system backups, add BACKUP=NETFS and BACKUP_URL variables to the/etc/rear/local.conf configuration file. To create a bootable USB device, combine OUTPUT=USB and BACKUP_URL="usb://dev/disk/by-label/REAR-000" as shown.

6. After configuring the back panel, run the following command to print out its current BACKUP and OUTPUT method configurations and some system information.

# rear dump

Step 2: Create Rescue System and Full System Backup

7. If all settings are correct, you can create a rescue system using the mkrecue command, as shown below, where the-v option enables verbose mode.

# rear -v mkrescue

Note: If you encounter the following error after running a rescue or backup operation, as shown in this screenshot.

UEFI systems: "ERROR: /dev/disk/by-label/REAR-EFI is not block device. Use `rear format -- --efi ' for correct format"

Use this command to format the USB drive and redo the operation.

# rear format -- --efi /dev/sdb

8. To create an emergency system and backup the system at the same time, use the mkbackup command, as shown.

# rear -v mkbackup

9. To create only a full system backup, use the mkbackup only command as follows.

# rear -v mkbackuponly

10. You can schedule ReaR to create rescue systems periodically using the cron job scheduler by adding appropriate entries in the/etc/crontab file.

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

The following configuration creates a rescue system or a full system backup every midnight. Make sure the USB stick is connected to it.

0 0 * * root /usr/sbin/rear mkrescue

or

0 0 * * root /usr/sbin/rear mkbackup

Step 3: Perform system rescue/recovery

11. To recover/restore a system after a disaster, connect a bootable USB memory stick to the bare metal system and boot from it. In the console interface, select option one (Restore hostname) and click Enter.

12. Next, the ReaR rescue system will be configured and you may be prompted to provide a replacement for the original network interface, as shown in the screenshot. When finished, click Enter.

13. Then log in as root (simply type the username root and click Enter) to run the actual recovery.

14. Next, run the following command to start the recovery process. The rescue system will compare disks, check their configuration and prompt you to select a disk layout configuration. Press Enter to continue automatic disk configuration.

It will then start the system layout restore, and once the disk layout is created, it will restore the backup, as shown in the screenshot below.

# rear recover

15. After the backup restore is complete, the rescue system runs mkinitrd to create an initial ramdisk image for preloading modules, then installs the boot loader and exits. After a system recovery is complete, the recovered system will be installed under/mnt/local/and moved to that directory for inspection.

Finally, restart the system:

# cd /mnt/local # rebooot

16. After the reboot, SELinux will attempt to relabel files and file systems on the recovered system based on the/mnt/local/.autorelabel file, as shown in the screenshot below.

For more usage options, read the ReaR man page.

# man rear At this point, the study of "What is the function of Linux system tool ReaR" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report