0%

Bare Metal Recovery Solution On Linux

When we talk about BMR (Bare Metal Recovery), we are talking about a solution to recovery the operating system, the configurations and the documents. Distinguished from fileset backup and restore, BMR is usually used as the last resort for disaster recovery. This blog shows an feasible solution for BMR on Linux system.

I implemented a volume backup utility mentioned in the article before: VolumeBackup. This utility can perform full backup and forever increment backup to generate a volume copy with a *.img format, which can be used to perform block level recovery from. Actually, some free software providing mature BMR solution, e.g., CloneZilla, peforms BMR via cloning full partition or even full disk. Block-level backup is much faster than file-level backup, thus proven to be an effective way for BMR.

How to backup

To recover a Linux system fully, we need to backup it fully firstly. What we need to backup contains:

  1. System state: This part contains system startup items like grub configurations, partition table, network configuration and so on.

The /boot folder stores EFI files, grub configuration and other files that are required for system startup, so it’s must be backuped. This directory neither contains too much files nor takes too much space (usually smaller than 500MB) so we can backup/recover it just at file-level. boot partition is usually initialized as a small standlone partition with FAT32 filesystem and must be the first partition on a disk with GPT partition table.

The root partition mentioned in the article refers to the volume that mount to /. It’s similiar to C:\ on Windows system where we call it System Drive and it’s must be backuped for BMR. Root partition is the place where Linux System and it’s applications and services installed, it may be large so it’s recommened to backup at block-level. If your root partition use a filesystem supporting snapshot creation like btrfs, you can create a snapshot and using VolumeBackup utility to clone it to a image format copy from the snapshot. If your root volume is a LVM logical volume, you can create the snapshot using LVM tools and perform the volume backup as well. If your root partition does not support consistency backup, you can shutdown the system and insert a new media to boot from, and backup the root volume from the new media.

Disk infomation and partitions infomation are also required to backup, they will be needed to recreate the partitions when doing BMR for the reason the partition infomation may be corrupted as well. If you are using LVM to manage your volumes, you alse need to backup your PV,VG,LV infomation.

  1. Document Patition
    Document partition refers to the partitions or volumes that used only for storing user data, which may takes large space but not crucial for system startup. This part is similar as drives like D:\,E:\ and so on, and should be supported to be selected by users to backup. For document parititions or volumes, we should also backup and recover it at block-level.

How to restore

Disqus评论区没有正常加载,请使用科学上网