How To Perform a Bare-Metal Backup On Linux LVM
perlow writes "Using the free System Rescue CD you can perform bare-metal backups and restores of many types of computer systems. In this article, ZDNet columnist Jason Perlow explains the multi-step procedure in detail on an LVM-based system."
http://www.mondorescue.org/
Step 1 - If your LVM hasn't forgotten its own configuration yet, get that sucker off an LVM as fast as you possibly can.
When I first discovered LVM (and it had already reached a quite mature V2 at that point), I thought it the greatest thing in volume management since the invention of the RAID.
I didn't half-ass it, I took my time to learn how it works, set up and broke a few, added a new PV and grew it to make sure it worked, backed some up, recovered from deliberately broken volumes (which works great - as long as you never try to bring the broken volume online by, say, rebooting), etc. Then I turned it on and loved it.
Then I received a hard lesson in what it means to say that JBOD has a failure rate multiplicatively proportional to that of each individual drive. And, surprise surprise, LVM amounts to nothing more than fancy OS-level JBOD, without even the performance boost of a proper RAID controller.
Thanks but no thanks. If I want to span a volume across multiple disks, I'll use RAID 5 or 6 from now on, ThankYouVeryMuch. I can only thank Zeus that I hadn't yet gotten around to cannibalizing my old file server when the LVM one day decided to eat itself (even if I could have salvaged something from the individual drives, I couldn't once it "fixed" its configuration to reflect the new PV set).
other features for bare-metal backup/restore involves:
Systemimager (dead good, and also good to restoring an image to other machines too). Restores from a cd (or PXE) boot and pulls the necessary data from the server with minimal intervention.
Any virtualisation technology - depends on your definition of 'bare metal', but if you think of it as an easy-to-restore server, then I guess it counts.
r1soft's (paid-for) continuous backup solution. Not tried this, but many webhost type companies have said its the dogs danglies.
sync before making snapshots.
That is all.
LVM is NOT the same as RAID5.
LVM makes it easy to move space around on the disks, but it does NOTHING to prevent data loss from failed disks.
Put LVM on top of a RAID 1 or RAID 5 subsystem. Then you can add / replace disks and grow the volumes to use the new space.
In cases where systems are using LVM and BMR is necessary, it might be wise to (heaven forbid) spend a little money and buy a product. Our company uses TSM for data and Storix for the bare-metal backups. (yes they support LVM)
When it comes to critical stuff, I like the idea of having someone to call when all hell breaks loose.
Don't get me wrong, I love centralized backups and backup server/client software (bacula for example). However I use old school methods for a bare metal restore. For simple things blanking the free space and then make a "dd" image is all you need. However you do it, keep it simple, and there may be no need to do bare metal on the whole of a file servers data set. Once I get the core of it back up I can use my favorite software to get the system up-to-the-last-snapshot current.
LVM and Raid can be a little complex if you boot off it so ill give some tips. A nice small boot like SLAX (may favorite) or Knoppix is needed to start any bare metal restore. Pick something that supports the hardware and had LVM and or Raid. Either make a custom disk to add your backup data to the volume or have a 2nd DVD drive. Boot and restore.
I make my backups via simple methods like rsync and tar. I use a few simple scrips to do it all. So simple that it is easy to restore by hand if need be. This makes the restore safer as it can be done a host of ways. Not to mention these unix tools are present in all distributions. Probably the biggest reason for the old school way is that on a bare metal restore often hardware may change. New drives etc, basically failure can be a reason to upgrade etc. Many utilities can choke on big hardware changes, new drive sizes and such.
I take detailed system information and note it in the backup as human notes. Then grab your raid & LVM configuration and write a quick script to rebuild these features via the command line. Basically just a list of the actions you take to make a file system and format them the desired files system types manually. These same scripts will also re-apply boot loader and such as well. If the volumes change after a failure I can just issue updated commands (or edit the script) and make a similar layout of the filesystem. Then just open the tar balls via script or by hand and populate the new filesystem with the files you archived. With a bit of practice all of this can be automated by scripts. But if you need to vary the procedure due to hardware changes or as a way to clone a system you can.
As long as you keep a sane filesystem plan, the entire thing can be kept in an easy to follow procedure and fully scripted (except for the tape change on the amanda server).
Um, never heard of 'dd' eh?
try 'man dd' and be enlightened to how redundant and pointless this article is.