Quantcast
Channel: All System Administration posts
Viewing all articles
Browse latest Browse all 1179

Re: ReaR configuration and recover

$
0
0

Since it's a VM system (which virtualization platform, by the way? VMware? SuSE virtualization with KVM? Something else?), it should be possible to present/unpresent additional virtual disks to the VMs as needed.

So, do you even need PXE netboot functionality for recovery? Just present an additional virtual disk to some VM, run "rear format /dev/<whatever>" to it, and that will be your recovery virtual disk. Verify that it contains all the tools needed to check, recover, recreate and mount btrfs filesystems. Unpresent it from the VM but don't destroy it. Think of it as a virtual USB stick with the recovery software installed.

When you need to recover a VM system disk, present this recovery virtual disk to that VM and set the VM to boot from it rather than its original system disk, but make sure the system still sees the original system disk too. Then boot the VM, run the recovery to the original system disk, then unpresent the recovery virtual disk and revert the VM configuration to what it was (i.e. boot from the restored system disk). That's it, your VM system disk (and optionally any other disks at the same time) is recovered.

Obviously, you should test this procedure to verify that it's possible for your virtualization platform, and possibly even script it so that the necessary VM configuration changes can be done automatically.

Note that Linux can use a command like "mount -o loop,ro /some/where/image.iso /mnt" to directly mount any files that contain a filesystem image. It's not limited to ISO images - any non-network filesystem type should work. ReaR probably handles all this automatically for you, but it's good to know in case you need to recover just one specific file from ReaR backups manually. (By the way, if you need to mount a disk image that includes a partition table and several partitions, you should learn about commands "losetup" and "kpartx" - with them, it's really easy to access partitioned disk images.)

Your local.conf examples are identical, except that the second one has a BACKUP_PROG_INCLUDE setting and the first one hasn't. The value of BACKUP_PROG_INCLUDE should be set to match how the filesystems are configured in your VMs; you should probably create your own BACKUP_PROG_INCLUDE value using a command line like the one described in https://github.com/rear/rear/issues/1330 :

findmnt -n -r -t btrfs | cut -d ' ' -f 1 | grep -v '^/$' | egrep -v 'snapshots|crash' | sed -e "s/$/\/*'/" -e "s/^/'/" | tr '\n' ' '

Run this command in your VM, and it should display a suggested BACKUP_PROG_INCLUDE value for you. Consider it as a starting point: for example, if you have PostgreSQL databases which are already backed up using a backup method that is more appropriate for them, it might not be necessary to back up all of /var/lib/pgsql/* using ReaR. (Filesystem-level backups from databases taken when the database is active are not likely to be useable, as the state of the database can change while the backup is being created, causing the backup of the database to be internally inconsistent.)


Viewing all articles
Browse latest Browse all 1179

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>