]> git.pld-linux.org Git - packages/amanda.git/blame - amlvm-snapshot.README
- drop obsolete and outdated manual inclusion of rpm macros
[packages/amanda.git] / amlvm-snapshot.README
CommitLineData
9b104ea3
JR
1Amanda LVM-snapshot Plugin
2==========================
3
4This plugin provides support for LVM snapshots in Amanda dumps. It interfaces
5with Amanda through the [Script API][1].
6
7Install
8-------
9
10Sorry, there's no Makefile yet. Simply copy the amlvm-snapshot.pl script into
11Amanda's application directory.
12
13For example:
14
15 cp amlvm-snapshot.pl /usr/libexec/amanda/application/amlvm-snapshot
16
17You may need to edit the location of Amanda's Perl libraries in the script
18itself, the following line.
19
20 use lib '/usr/local/share/perl/5.8.4';
21
22Configure Amanda
23----------------
24
25Somewhere in your Amanda config you must define a `script-tool` that loads the
26plugin. You can simply include the provided `lvm-snapshot.conf` file if you like.
27
28 cp lvm-snapshot.conf /etc/amanda/DailySet1/lvm-snapshot.conf
29 echo 'includefile "lvm-snapshot.conf"' >> /etc/amanda/DailySet1/amanda.conf
30
31Once you have the `lvm-snapshot` `script-tool` defined, you can include it in
32a `dumptype` definition. Note, however, that your dumptype _must use an
33application-tool program_: Only application-tool programs can handle the
34alternate mount point—of the snapshot device—that the script defines.
35
36 define dumptype lvm-comp-amgtar {
37 comment "LVM snapshot dumped with amgtar"
38 global
39 program "APPLICATION"
40 application "app_amgtar"
41 script "lvm-snapshot"
42 compress client fast
43 index
44 }
45
46To allow amanda to dump more than one lvm-snapshot in parallel,
47lvm-snapshot.conf has to have something like:
48
49 property "SNAPSHOT-SIZE" "250"
50
51(the unit is PEs, for LVM PE Size 4,00 MiB it results in 1G snapshot-size)
52
53otherwise the first snapshot uses up all extents and the second snapshot fails.
54
55Configure Permissions
56---------------------
57
58This plugin requires elevated permissions in order to create and remove LVM
59devices. There are two ways to provide access: setting setuid on the plugin
60script itself, or by configuring `sudo` to allow execution of the LVM
61programs.
62
63### setuid
64
65NOTE: I'm currently having trouble getting this to work right, as Amanda's
66Perl libraries don't seem to play nice with setuid scripts.
67
68For setuid, simply configure the ownership and mode on `amlvm-snapshot`. In
69this example, `disk` is the group that Amanda runs under.
70
71 chown root:disk /usr/libexec/amanda/application/amlvm-snapshot
72 chmod 4750 /usr/libexec/amanda/application/amlvm-snapshot
73
74This will require that you have a version of Perl installed that was compiled
75with `ENABLE_SUIDPERL`.
76
77### sudo
78
79For sudo, add the following to the `/etc/sudoers` file where "amandabackup" is
80the name of your Amanda user.
81
82 amandabackup ALL=(ALL) NOPASSWD: /sbin/lvcreate, /sbin/lvdisplay, /sbin/lvremove, /sbin/vgdisplay, /bin/readlink, /bin/mount, /bin/umount, /sbin/blkid
83
84The commands listed are those used by `amlvm-snapshot` to interact with the
85LVM volumes.
86
87Remember to enable the `SUDO` property. This is already included in the
88example `lvm-snapshot.conf` file.
89
90 define script-tool lvm-snapshot {
91 # ...
92 property "SUDO" "1"
93 }
94
95Enjoy,
96Daniel
97
98[1]: http://wiki.zmanda.com/index.php/Script_API
This page took 0.199063 seconds and 4 git commands to generate.