
Re: Info on doing a bare metal restore using fsarchiver.
EDIT: I understand I'm replying to an old topic, but I wanted to get this information out there in case it can help someone else.
I've been doing some work on this for my job. We're transitioning our customers from their IBM AIX servers onto RedHat Linux servers, mainly because of price. The nice thing about AIX is that they have a "mksysb" which does a complete restoreable system backup to a tape drive.
What I've been trying to do is something similar for Linux and FSArchiver is the closest I can get.
Here's my basic process:
1) Backup the partition tables using sfdisk
2) Backup the boot partition (which is outside of LVM) using fsarchiver, with the -A option
3) Backup all of the logical volumes using the snapshot feature
4) Backup the LVM configuration using vgcfgbackup
5) Either backup the LVM physical volume information separately or just reference the config file from step 4.
Then, when I go to do a restore:
1) Restore partition tables using sfdisk
2) Restore the boot partition using fsarchiver
3) Re-create swap filesystem if necessary (by just using mkswap)
(and here's the tricky part)
4) Re-create the physical volume(s) using pvcreate, specifying the same UUID as before.
Code:
pvcreate --restorefile lvmbackup.conf --uuid "Pirpip-wgVD-3AOv-gwVe-FJWN-yGR6-7Qs7Sp"
5) Restore the LVM configuration using vgcfgrestore
6) Bring volume group back up using vgchange -a y /dev/<vg name>
7) Restore logical volumes using fsarchiver
8) Since I'm not backing up the MBR, at this point I would mount all of my partitions and chroot into them so I can re-install grub, because restoring the MBR always seems to be a little flaky for me. From my experiences, GRUB seems to reference individual sector numbers, and if any of these gets restored different, restoring the MBR just flat isn't going to work. This is why I do a manual grub install.
Using these methods, I have completely backed up an entire system, while it was running, shut it down, swap hard drives, and restored it to a new hard drive. The system booted back up like nothing ever happened.
Let me know if you have any questions or if anything seems unclear. I've been through so many different trials and tribulations related to getting these backups working, so I may have made a mistake somewhere.