Don’t Wait Until It’s Too Late: File Backup vs. System Backup?
If you’ve ever pulled an all-nighter reinstalling a CentOS server from scratch because of a hard drive failure, you know that feeling of helplessness when everything is gone. Usually, we use rsync or tar to push data. This works fine until the server’s hardware dies completely or a kernel error makes it unbootable.
In those cases, the recovery process is often exhausting: reinstalling the OS, repartitioning, configuring the network, and then finally restoring the data. For a skilled technician, this takes at least 3-4 hours. ReaR (Relax-and-Recover) was created to cut this time down to minutes. It performs Bare Metal Recovery (BMR) — restoring an entire running system from scratch with a single command.
Comparing Practical Backup Methods
Based on operational experience, I divide backups into three levels for easy selection:
- Level 1 (File-level): rsync, Bacula. Pros: Lightweight, easy to manage. Cons: You must rebuild the OS environment before restoring data, which requires significant effort to reconfigure from scratch.
- Level 2 (Snapshot): VMware, Cloud Snapshot. Very fast and secure but strictly dependent on the virtualization platform. If you’re running physical servers (Bare Metal), this method isn’t flexible.
- Level 3 (ReaR): Creates a bootable ISO containing all drivers, bootloader, and data. You just mount the ISO via iDRAC/IPMI and run a command. It combines the flexibility of file-level backups with the comprehensiveness of snapshots.
Why ReaR is a Lifesaver for CentOS Systems
Back when CentOS 8 was approaching EOL, I had to urgently migrate five critical servers to Rocky Linux in one week. Using ReaR to create backups before the transition was the best decision I ever made. When a migration script broke the system, it took me exactly 15 minutes to revert to the previous state instead of spending the whole afternoon typing commands.
The biggest plus is that ReaR is completely free and extremely lightweight. It doesn’t run in the background, so it won’t consume RAM or CPU. This tool only works when you trigger a backup command.
Deploying ReaR on CentOS in 3 Steps
In this example, we will store the backup on another server using the NFS protocol. This is a standard practice in Datacenters to ensure data safety.
1. Install Required Packages
Start by installing the rear package and the genisoimage tool for ISO creation. Don’t forget nfs-utils to connect to the remote storage server.
sudo yum install rear genisoimage syslinux nfs-utils -y
2. Configure the local.conf File
The main configuration file is located at /etc/rear/local.conf. Suppose your NFS server has the IP 192.168.1.50 and the shared directory is /mnt/backups. Add the following content:
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=nfs://192.168.1.50/mnt/backups
BACKUP_PROG_EXCLUDE=("/tmp/*" "/dev/*" "/proc/*" "/sys/*" "/run/*" "/mnt/*" "/media/*")
Quick explanation: OUTPUT=ISO creates a bootable file. BACKUP=NETFS uses the built-in backup engine. BACKUP_PROG_EXCLUDE helps exclude temporary directories to reduce the backup file size (this can shrink it from several GBs to a few hundred MBs if configured correctly).
3. Create the First Backup
Everything is ready. Run the command below to let ReaR start packaging the system:
sudo rear -v mkbackup
Once finished, a folder containing the rescue ISO and a backup.tar.gz file will appear on the NFS server. This is your lifeline.
Disaster Recovery Workflow
Suppose the server’s hard drive fails completely. After replacing it with a new drive, follow these steps:
- Mount the ReaR ISO to the server via USB or an iDRAC/ILO virtual disk.
- Boot from the ISO and select “Relax-and-Recover” from the menu.
- Log in as the
rootuser (no password by default). - Run the command:
rear -v recover
At this point, ReaR will automatically repartition the drive exactly as it was before. It formats the file systems (XFS/EXT4), mounts the drives, and extracts the data from NFS. Finally, it automatically reinstalls the Grub Bootloader for you. Simply type reboot, and the server will restart as if nothing ever happened.
Real-world Experience to Avoid Common Errors
Real-world deployments often run into small but frustrating issues. You should keep the following in mind:
- Network Card Handling: When booting from the ISO, sometimes the network card doesn’t get an IP automatically. Be prepared to use the
ip addr addcommand to assign an IP manually so the server can see the NFS storage. - /tmp Capacity: ReaR needs free space to build the ISO. If this partition is full, the
mkbackupcommand will fail immediately. - The “Fake Backup – Real Restore” Principle: Don’t trust a backup file until you’ve successfully tested a restore on a virtual machine. I always require my technical team to perform recovery drills every three months.
A good system administrator isn’t someone who keeps a system from ever breaking. It’s someone who can bring the system back online as quickly as possible. ReaR is the best insurance policy for your CentOS infrastructure.

