Gentoo Archives: gentoo-user

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