I read a description of a very intriguing backup strategy that seems to fit my requirements. I need help to:

  1. implement it manually one time
  2. automate it to run periodically

Here's the original article describing the concept:
http://www.howtoforge.com/creating-portable-disksafes-with-loopbackfs-and-lvm-snapshots

Here's my situation:

  • home file server with about 1.2 TB of stuff to be backed up
  • external 2.0 TB USB drive available to hold all the backed up stuff
  • another external 2.0 TB USB drive available, if needed.

Requirements:

  • images of root, /home and /var in the form of LVM logical volumes that are ready to mount at restore time. (I plan to snapshot these LVs and backup while the server is running.)
  • image of /boot (which is not an LVM LV and which I assume doesn't need to be snapshotted anyway as it won't be changing)
  • copy of MBR (I have a simple script for making incremental copies)
  • file-based backups of non-LVM paritions containing media --music, video, documents, etc.(I will use storeBackup for this, which is like rsync but it finds duplicates by content rather than just file name)

Request:
What I'm looking for is a step-by-step recipe similar to the source article style, but applicable to my situation.

Some initial questions are:

  1. should I prepare the external 2.0 TB USB drive with 1 standard partition or should I use LVM (maybe with 1 vg and 1 or more logical volumes)?
  2. is LVM mirroring a reasonable way to initially duplicate the logical volumes onto the external 2.0 TB USB drive? If not, what's the best way to copy the source logical volumes to the external drive and end up with ready-to-use logical volumes? Mirroring seems crucial to this strategy because (I hope) it will avoid requiring future periodic full copies of the source LVs. (But that's only a hopeful guess.)
  3. Once the logical volume copies are in place on the external drive, can I take snapshots of these backup LVs?
  4. Assuming I can snapshot the backed up LVs, at the next period backup from source, can I quickly sync the copy then take another snapshot? The idea I'm going for is to:
    • establish the LV mirror on the external drive
    • make a post-backup snapshot of the LV on the EXTERNAL DRIVE
    • break the link between the mirrored LVs
    • after a week, resync the mirror (should involve just copying changed blocks, I hope)
    • make another post-backup snapshot of the LV on the EXTERNAL DRIVE
    • again, break the mirror so that the source file system is not doing any copy-on-write, etc.

Concepts:

  • pre-backup snapshots: these are ordinary LVM snapshots used in the traditional manner
  • post-backup snapshots: these are intended to be permanent references to earlier points in time in the "backup series".
  • backup series: a "mirror" of the source logical volume together with periodic snapshots that are retained indefinitely.

Limitations:
I've never used LVM snapshots before!

link|improve this question
1  
LVM snapshots impose a huge performance penalty and should only be used temporarily. – Mark Wagner Apr 12 '11 at 16:29
I am doubtful whether using LVM snapshots really buys you anything but unnecessary added complexity. My read of your situation is that a simple rsync script should be sufficient to handle your backup. Or, you could "go to the next level" with an rsync-based solution like rsnapshot or dirvish. – Steven Monday Apr 12 '11 at 16:37
As @embobo said, this is not a great solution for performance reasons (also note that the more snapshots you take the worse performance gets, as you have to track changes in each snapshot). The normal use for snapshots during backups is "Make a snapshot, mount the snapshot, back up the snapshot, unmount the snapshot, delete the snapshot" – voretaq7 Apr 12 '11 at 16:38
@embobo, I do not see the reasons for concern about performance. If the backup can be completed overnight, then the mirror will be broken and the server will perform normally during the time it is accessed. Please see my concept of post-backup snapshots for clarification of what I'm trying to accomplish. If this works, I will end up with a series of snapshots on an external volume. This external volume will be disconnected from the server during normal operation, so performance should not be a concern. – MountainX Apr 12 '11 at 17:29
@Steven Monai - the post-backup LVM snapshots buy me references to earlier points in time without keeping multiple full copies of each LV. This saves space (and hopefully time). I'm already using "the next level" - it is storeBackup, which I think is better than rsync, rsnapshot or dirvish. Now I want to go to the next-next level with the concept discussed above. Of course, I realize that this concept may not work. I'm simply at the stage where I hope it will work. But I am way past the stage of rsync. – MountainX Apr 12 '11 at 17:33
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.