fsarchiver forums
View unanswered posts | View active topics It is currently Sun May 19, 2013 12:22 am



Post new topic Reply to topic  [ 4 posts ] 
 Info on doing a bare metal restore using fsarchiver. 
Author Message

Joined: Wed Jun 22, 2011 9:22 am
Posts: 10
Post Info on doing a bare metal restore using fsarchiver.
I've been the maintainer for the g4l project for many years.
It had partimage before I took over, but have recently added the fsarchiver as an options as well.
I have not implemented all the options, but have it so it can do partition backups, and one can select
compression options.
I've also been able to backup LVM partitions using it as the /dev/dm? directories.

In a simple test, I backed up the LVM partition of 250GB and it took about 25 minutes to backup using
fsarchjver compared to the dd backup that takes about 1 hour 40 minutes. The space used on the / is only
about 40GB, so fsarchivers file level backup doesn't have to deal with the unused space.

The difference is that a full disk backup using g4l would restore all the partitions, LVM, mbr and partition table.
I could also restore the mbr and partition table using the MBR options of g4l, and then restore the LVM, which
would include the include the / and swap partitions of the LVM.

I'm looking at adding options to be able to do a bare metal type restore, but the issue would be recreating the LVM setup.
The MBR backup would create the physical partitions, and I think the vgcfgbackup and vgcfgrestore could be used to
resetup the LVM, but I have not done a test of this? Don't know if fsarchiver could backup the swap partitions, or if it would
be worth it. If not come up with a way to recreate the swap LVM partition.

Don't know if others have done something like this, or could provide some suggestions.

Thanks.


Wed Jun 22, 2011 11:55 pm
Profile

Joined: Thu Nov 15, 2012 6:44 pm
Posts: 4
Post 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.


Thu Nov 15, 2012 6:56 pm
Profile

Joined: Tue Feb 05, 2013 7:38 pm
Posts: 1
Post Re: Info on doing a bare metal restore using fsarchiver.
Your guidelines are very helpful, but your post would become downright invaluable if you could fill out actual command sequences and parameters. I understand that fsarchiver forum members might know how to fill in the blanks, but I came here from Google looking for a bare metal LVM backup/restore solution. It's frustrating to have the outline in front of me, but not know how to implement the details. I think a detailed example would earn many hits. The few examples I've found so far on the 'net do not work. Thanks, whatever you decide.


Tue Feb 05, 2013 7:45 pm
Profile

Joined: Wed Jun 22, 2011 9:22 am
Posts: 10
Post Re: Info on doing a bare metal restore using fsarchiver.
Just a quick question? Why not just backup the disk as a one step process?
That would include the mbr, partitions, and everything for a true bare metal backup.
The only issue is that it does take a bit more time and size if you don't clear the unused space.

I maintain the g4l project that does this type of backup, and it includes fsarchiver for other options,
but I have only used it a few times.

Concerning the size issue, I once did an image of a fresh install of Fedora Core 3 on an 80GB disk,
and the image created was 12GB. I then cleared the free space on the partitions, and redid the image,
and it was only 2.5G.

In the raw mode, it is used dd to read the sectors, and then compress them to an image file, so it is
an all backup process for the disk or partitions.


Wed Feb 06, 2013 2:41 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.