1 Amanda LVM-snapshot Plugin
2 ==========================
4 This plugin provides support for LVM snapshots in Amanda dumps. It interfaces
5 with Amanda through the [Script API][1].
10 Sorry, there's no Makefile yet. Simply copy the amlvm-snapshot.pl script into
11 Amanda's application directory.
15 cp amlvm-snapshot.pl /usr/libexec/amanda/application/amlvm-snapshot
17 You may need to edit the location of Amanda's Perl libraries in the script
18 itself, the following line.
20 use lib '/usr/local/share/perl/5.8.4';
25 Somewhere in your Amanda config you must define a `script-tool` that loads the
26 plugin. You can simply include the provided `lvm-snapshot.conf` file if you like.
28 cp lvm-snapshot.conf /etc/amanda/DailySet1/lvm-snapshot.conf
29 echo 'includefile "lvm-snapshot.conf"' >> /etc/amanda/DailySet1/amanda.conf
31 Once you have the `lvm-snapshot` `script-tool` defined, you can include it in
32 a `dumptype` definition. Note, however, that your dumptype _must use an
33 application-tool program_: Only application-tool programs can handle the
34 alternate mount point—of the snapshot device—that the script defines.
36 define dumptype lvm-comp-amgtar {
37 comment "LVM snapshot dumped with amgtar"
40 application "app_amgtar"
46 To allow amanda to dump more than one lvm-snapshot in parallel,
47 lvm-snapshot.conf has to have something like:
49 property "SNAPSHOT-SIZE" "250"
51 (the unit is PEs, for LVM PE Size 4,00 MiB it results in 1G snapshot-size)
53 otherwise the first snapshot uses up all extents and the second snapshot fails.
58 This plugin requires elevated permissions in order to create and remove LVM
59 devices. There are two ways to provide access: setting setuid on the plugin
60 script itself, or by configuring `sudo` to allow execution of the LVM
65 NOTE: I'm currently having trouble getting this to work right, as Amanda's
66 Perl libraries don't seem to play nice with setuid scripts.
68 For setuid, simply configure the ownership and mode on `amlvm-snapshot`. In
69 this example, `disk` is the group that Amanda runs under.
71 chown root:disk /usr/libexec/amanda/application/amlvm-snapshot
72 chmod 4750 /usr/libexec/amanda/application/amlvm-snapshot
74 This will require that you have a version of Perl installed that was compiled
75 with `ENABLE_SUIDPERL`.
79 For sudo, add the following to the `/etc/sudoers` file where "amandabackup" is
80 the name of your Amanda user.
82 amandabackup ALL=(ALL) NOPASSWD: /sbin/lvcreate, /sbin/lvdisplay, /sbin/lvremove, /sbin/vgdisplay, /bin/readlink, /bin/mount, /bin/umount, /sbin/blkid
84 The commands listed are those used by `amlvm-snapshot` to interact with the
87 Remember to enable the `SUDO` property. This is already included in the
88 example `lvm-snapshot.conf` file.
90 define script-tool lvm-snapshot {
98 [1]: http://wiki.zmanda.com/index.php/Script_API