Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: snackup
Date: Fri, 07 May 2010 19:36:10
Message-Id: 201005072135.14449.wonko@wonkology.org
In Reply to: Re: snackup (was: Re: [gentoo-user] backup to a cold-swap drive) by covici@ccs.covici.com
1 covici@××××××××××.com writes:
2
3 > I have a question -- where would lvm put a snapshot and how could I
4 > pass some list of excludes to rdiff-backup. I have an lvm which is
5 > taking all the PEs and a snapshot would take up lots of disk space --
6 > or would it. Would I need some free pes to put the snapshot?
7
8 An LVM snapshot has to be in the same volume group as the LVM. If all your
9 physical extends are full, this will not work I'm afraid.
10 But you can reduce the size of one LVM with lvreduce. Of course you have
11 to resize the file system inside first. This is a little more complicated
12 than extending the size, because you have to specify the size when
13 reducing the file system and the LVM. And the file system has to be
14 unmounted :(
15
16 Let's say you want to reduce your data partition of 15G to 10G:
17
18 umount /dev/myvg/data
19 fsck -f /dev/myvg/data
20 resize2fs /dev/myvg/data 9G
21 lvresize -L 10G /dev/myvg/data
22 resize2fs /dev/myvg/data
23 mount /dev/myvg/data
24
25 The 2nd resize2fs maximizes the size of the fs inside the LVM. I do not
26 know (does anyone else?) if you could skip this and reduce it to 10G in
27 the first resize2fs step. Just to be on the safe side I reduce it a little
28 more, and let it adapt do the reduced LVM size afterwards.
29
30 The snapshot itself takes nearly no space at all - it only keeps the
31 changes that occur in the LVM while the snapshot is in place. So it grows
32 when you modify the LVM you snapshotted. When you do not much
33 modifications, 15-20% is enough according to the lvcreate man page. And I
34 think I had it much lower without problems. I would expect that it can be
35 really small when you do not change the original LVm much. snackup uses 2G
36 as default, change this with option -s. Of course, when you do large
37 modifications, like creating larger files, this may be too small.
38
39 Excludes can be given with the -x option (multiple times). And have a look
40 at the config template that snackup -T gives you. Near the bottom, the
41 variable oXclude is defined. It is an array, just change it to your needs.
42 it already excludes things like ccache, kdecache-* directories,
43 */tmp/portage, and the dreaded nepomuk directory fo KDE4 because this
44 sometimes gets really REALLY large here.
45
46 snackup -x dip -x dap would exclude the stuff already pre-defined and dip
47 and dap. If you want to exclude dip and dap only, call snackup -x "" -x
48 dip -x dap. But I find it easier to adapt the oXclude array.
49
50 Wonko

Replies

Subject Author
Re: [gentoo-user] Re: snackup covici@××××××××××.com