SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Support for LVM snapshots [patch]
Author Message
Post Support for LVM snapshots [patch] 
On Fri, 2007-07-27 at 23:30 +1000, Ben Low wrote:
This is a rationale and patch to add explicit LVM snapshot support to
rsnapshot.

I very much like the idea. It just happens I was experimenting with lvm
to make a backup of a zimbra setup. (1)

It would also help on different setups were rsync encounters "vanished
files", which I encounter daily.

I wanted to use rsnapshot on various LVM logical volumes, and
initially considered the cmd_preexec option to create and mount all
of the LVM snapshots and cmd_postexec to unmount and remove them
afterwards. This would work, though is less than ideal as you need to
allow a reasonable amount of space for the LVM snapshots (say 10%),
and I don't have that much space free. It would also a pain to
maintain the separate pre- and post-exec scripts.

Ack.

Better would be to create+mount each snapshot "on demand", i.e. for
each backup. This has a number of benefits, including not needing as
much snapshot space as the snapshots are only kept for as long as
they need to be (not hanging around for the entire backup). The
attached patch adds support for the 'lvm://' backup option:

backup lvm://vg0/home/ lvm-vg0/home/
backup lvm://vg0/data/ lvm-vg0/data/

Nice. Does the backup source takes a logical volume only, or can one add
subdirectories of the lvm? I would expect the latter one.

This will take an LVM snapshot of vg0/home, mount it, take an
rsnapshot as per any normal filesystem, unmount the snapshot, and
remove it. It will then repeat the exercise for vg0/data.

Seems to work very well for me. Only niggle is that the current
versions of lvcreate and lvremove emit "created" / "removed"
messages, they need a "--quiet" option.


Can you confirm on which version of rsnapshot this patch is based? I'll
have a look and test it on my zimbra test host.


(1)
http://wiki.zimbra.com/index.php?title=Open_Source_Edition_Backup_Procedure


Serge

--
Serge van Ginderachter http://www.vanginderachter.be/

Philip Paeps wrote on Monday 10 April 2006 22:31 in be.provider: > Ik
ben de diplomaat niet.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

Post Support for LVM snapshots [patch] 
Hi, thanks for a very good idea. I have LVM everywhere too, so I could
use it Wink But will it work remotely ?

For example something like that (??):

backup root < at > remote:lvm://vg0/home/ lvm-vg0/home/


--
Janek Kozicki |

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

Post Support for LVM snapshots [patch] 
Ben Low said: (by the date of Tue, 7 Aug 2007 11:19:48 +1000)

(i.e. you need enough free space in your LVM volume
for the sum of all your snapshots).

yes, exactly.

What about a more general approach to my LVM patch: effectively
the desire is to launch a command before and after every rsync
call, e.g.:

backup script://path/to/your/script vg0/home workstation/
script_args="additional args that get passed to the script"


interesting idea, looks to be easy to implement. how about this:

backup script://path/to/start_script "--foo=42 --bar" vg0/home workstation/ script://some_end_script "--foo=42"

the "" is mandatory after script:// to make things simpler. It could
be empty, ie.: just "".


2. If "yes": this could completely replace the lvm:// patch, but
would lose the "simple" (but os-specific) lvm:// specification and
argument checking - do we leave or remove lvm://?

3. This would supersede backup_script, no?

yes, I think that what you propose is a better solution than your lvm
patch, because it's more general.


reads the rsync command from SSH_ORIGINAL_COMMAND (see ssh man page).

thanks for the idea. I was considering this, but it was just simpler
to use cmd_preexec, and I have enough unallocated lvm space.


best regards
--
Janek Kozicki |

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

Post Support for LVM snapshots [patch] 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Interesting discussion so far, albeit no solution for my personal setup,
so far. What I was personally thinking about is to build a script that
takes care that for every backup_root, the directory tree is descended,
and if directories are found that are mounted LVs, a snapshot volume is
used instead. This is because I simply backup / and would like /usr,
/var etc. which are on LVs to be snapshotted. Naturally, this would
require enough space in the VG for all LVs found.

- --
Pieter "Fate" Hollants <pieter < at > hollants.com>
(a current GnuPG key is available at www.hollants.com/gnupg.txt)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGvGgSa8/cc5b1WpwRAtHnAKCG50WArz+gAxmkXbRBTh4XtPbMCACgqA4o
caBcGXpM8uLnBF1KrF0GX04=
=kpoS
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

Post Support for LVM snapshots [patch] 
On Thu, Aug 02, 2007 at 04:17:47PM +0100, David Cantrell wrote:
On Fri, Jul 27, 2007 at 11:30:18PM +1000, Ben Low wrote:
This is a rationale and patch to add explicit LVM snapshot support to
rsnapshot.
If we're going to add platform-specific functionality, I'd like the
relevant config options to include the platform name - so rename, eg,
lvm_snapshotsize to linux_lvm_snapshotsize, and also something similar
in the is_lvm_path function's name, and the new variables. That will
help to avoid confusion if in the future we add support for some other
OS's native "moment-in-time" snapshots, and will also make it crystal
clear to users what is and is not supported on their system.

Also because the new cmd_* options are specific to Linux LVM, could you
rename them to linux_lvm_... as well.

I've applied Ben's patch to CVS, with those changes. I hope I caught
them all :-)

Ben, can you check out the latest version and make sure that I applied
it right? I can't test it myself as I don't have LVM myself.

--
David Cantrell | A machine for turning tea into grumpiness

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

Display posts from previous:
Reply to topic Page 1 of 1
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
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB