Stories
Slash Boxes
Comments

News for nerds, stuff that matters

How To Perform a Bare-Metal Backup On Linux LVM

Posted by timothy on Wednesday May 07, @03:00PM
from the you-may-touch-only-the-heavy-atoms dept.
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."

Related Stories

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
    • Re: (Score:3, Informative)

      Mondo is cool, but it is not platform independent and usable on a live CD. It requires installation and compilation on each box to build its own rescue environent.

      The objective of my procedure was to come up with a method that could back up ANY Linux distr

        • I'll look into this and correct if necessary. It appears to be redundant because the config backup files contain the UUID.
    • Mondo is excellent for disaster recovery of the Linux Operating System with the advantage of producing a recovery iso without shutting down the system. While you do need to compile the source it is fairly easy to do this and the compiled binaries can easil
  • Sure - Don't. (Score:4, Interesting)

    by pla (258480) on Wednesday May 07, @03:23PM (#23328320) Journal
    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).
    • Re:Sure - Don't. (Score:4, Insightful)

      by bernz (181095) on Wednesday May 07, @03:34PM (#23328496) Homepage
      You make sure that all your devices block devices (at least if you're in a "Real Enterprise") are at least mirrored. Just because LVM2 writes across all disks, doesn't mean you're in a single-point-of-failure mode (or RAID0 or JBOD). You just make sure your "disks" are not just a single Physical Disk, but rather a LUN composed of a RAID6 with multiple paths anf power-supplies.

      And if you're not an Enterprise, this can be done on the "cheap" with RAID6 commodity boxes running as iSCSI targets.

      If you're ever relying on a single device for ANYTHING you're doing it wrong. But LVM is perfectly safe if you do it in a responsible way. It just isn't necessarily super-cheap.
      • Re: (Score:3, Insightful)

        If you're ever relying on a single device for ANYTHING you're doing it wrong. But LVM is perfectly safe if you do it in a responsible way.

        I agree completely - And mostly meant that as my point (with an anecdote about myself as an otherwise-knowledgeable
        • I use LVM on all my single-drive setups. I use it on this 16GB compact flash-equipped laptop. It's very convenient to be able to shrink and grow partitions on the fly, when testing new distros or using virtualization. On the machines that I actually use it
        • Re: (Score:3, Informative)

          IMO the big thing that LVM offers is it makes reproportioning easier and safer.

          With traditional partitioning you have to slide the data along the drive (which requires you to take the system offline, is time consuming and will probablly screw things up big
        • Re: (Score:3, Insightful)

          LVM does work exactly as advertised - It just shouldn't have anywhere near the popularity it currently enjoys. For example, several Linux distros (Fedora comes to mind) set up an LVM by default. Ouch.

          What the heck's wrong with that? I've been doing t

    • Yeah, that's kinda how it works. LVM is a volume management system, not a data protection system. LVM is still decent, but use underlying RAID devices as your PVs. That way you still have the flexibility of LVM without being susceptible to single-disk f
    • LVM shouldn't be used except on drives on a redundant RAID level. As long as you take that basic precaution, it's fine and can be fairly useful.
    • so lets get this straight, just for the record. You installed LVM and added additional drives to a single volume (in much the same way as you'd do with a RAID0 setup) and when 1 drive failed you were surprised that you lost all your data?

      Its not magic, you
    • Re: (Score:2, Informative)

      There are rarely free lunches when it comes to computer system configuration choices - and when there are free lunches, you can be sure that the hardware / software will be using that configuration by default.

      The safest bet is this: If you aren't sure tha

    • Of course it would behave like JBOD if you applied LVM over many non-redundant volumes. To expect redundancy protection from a tool that does not provide it by nature is like expecting blood from stones. Use LVM to best effect on whopping great raid volume
    • Re: (Score:3, Interesting)

      I didn't half-ass it, I took my time to learn how it works, [...]
      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 not

    • 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 ne
      • Not RAID 5, but you can map two physical extents on different disks to a single logical extent. This would be similar to RAID 1.
    • You can span LVM across many individual PV points of failure (i.e. single disks), but only morons do that. The right way to use LVM is to layer it above the redundant (RAID) storage, and/or make sure you have really good backups if you're only using LVM fo
    • Now for the important question: what's the proper word for self-cannibalism? Autocannibalism?
    • You mean you actually thought at first that the LVM was supposed to replace a RAID mirrored and striped array? Son, that's where you made your mistake. Create the raid, put the LVM on top of the raid.

      That's just dumb.
    • I don't know about the rest of y'all, but my filesystems are generally RAID arrays running LVM on top of them. i.e. my home fileserver has a pair of 300G drives, four 250G drives and a pair of 200G drives. I have it configured into two RAID1s and a RAID5
  • Hmm. (Score:4, Informative)

    by gbjbaanb (229885) on Wednesday May 07, @03:49PM (#23328676)
    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.
  • by dnamaners (770001) on Wednesday May 07, @04:38PM (#23329376) Journal
    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.
      • I'm using tar to store the stuff on-the-fly to an FTP site. I even made a flexible backup script [wertarbyte.de] to coordinate upload, snapshotting, encryption and everything else. It's completely based on standard unix tools, so I won't have to install any special backup