Gentoo Archives: gentoo-user

From: Nganon <nganon+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to build a time machine on Gentoo
Date: Mon, 16 Aug 2010 10:28:47
Message-Id: AANLkTimOLteya7ni-7FLH+xZ_MfsHtY7C_2YQ=zAtXMN@mail.gmail.com
In Reply to: Re: [gentoo-user] How to build a time machine on Gentoo by Alex Schuster
1 On 16 August 2010 03:15, Alex Schuster <wonko@×××××××××.org> wrote:
2
3 > Nganon <nganon+gentoo@×××××.com <nganon%2Bgentoo@×××××.com>> writes:
4 >
5 > > Hello all,
6 > >
7 > > My first post on the list. I thought I would start with something
8 > > that I started
9 > > to think of as 'essential' after losing 90GB of data. Now I have two
10 > > main questions in mind: what to and how to back up on gentoo most
11 > > efficiently.
12 > >
13 > > 1. Apart from users' home directories and the followings, what should
14 > > be backed
15 > > up on a gentoo machine?
16 > > /etc/portage/
17 > > /root
18 > > /var/lib/portage
19 > > ...?
20 >
21 > Wouldn't it be easier to just backup the whole / directory?
22 > Excluding /home, /usr/portage and /var/tmp/portage?
23 >
24 > Yes but that would not solve my huge backup file problem, would it?
25
26
27 > > 2. Erm..okay, I am gonna say, what magic I want and then ask your way.
28 > > I first started making gzipped tar balls as follows:
29 > >
30 > > tar czpf /media/backups/userA-`date +%Y.%m.%d`.tgz -X
31 > > userA-excludelist /etc
32 > >
33 > > But these can get huge especially for home dirs. I also want safe dvd
34 > > copies.
35 > > Though I can find enough space on the external drives, I don't trust
36 > > them any more. See above..sigh..(No I recovered about one third of it
37 > > with testdisk/photorec
38 > > which names them as file000001 file00002.. and half them are zero
39 > > sized.. which
40 > > quite justifies my agony)
41 >
42 > Okay, but I don't trust DVDs. Although DVD-RAM is quite safe I heard.
43 > But external disks are flexible, offer more space, and if you want more
44 > security, just use yet another drive, so you are safe even if your main
45 > drive and a backup drive fails.
46 >
47 > I did not give a thought to DVD-RAM before. Will give it a try. Thanks.
48
49 I suggest you have a look at rdiff-backup. It gives you a 1:1 copy of
50 > the source directory, but also does incremental backups, which are
51 > stored (in compressed form) in an additional folder in the destination
52 > directory. I would use this at least for things like /etc, where I
53 > sometimes might want to retrieve an old version of a file. Similar to
54 > your approach with big tar files and small ones containing the
55 > increments.
56 >
57 > I just emerged and tried it. Seems like incremental backups was what I
58 was looking for. But from what I see, it is mirroring the src to dist and
59 storing the metadata/stats of increments as archived. Maybe there is an
60 option to archive increments along side their metadata as well. I will keep
61 playing with it.
62
63 I use a script for my backups, which I mentioned here on 2010-05-07,
64 > subject 'Snackup'. It optionally creates LVM snapshots so I can make
65 > backups from the running system, even if the source directory is
66 > altered during the backup. This works on LVM only, though, and also
67 > allows the volume to be LUKS-encrypted. It does backups by rdiff-backup,
68 > rsync, cp, tar or dd. It may be overkill when not using the LVM
69 > features, but still I suggest to use some script for backups, so one
70 > does not always have to remember the backup commands. When I want to
71 > update my backup, I enter something like 'snackup boot root home src',
72 > and the script backs up my boot, root and home partition in the
73 > background, and creates tar files each directory in /usr/src.
74 >
75 > I found the thread and script. I am gonna take a look at it. Once I decide
76 on
77 how to backup, I am gonna cron a script for it.
78
79
80 > > By the way, since I want dvd backups as well, and I want to use +rw
81 > > dvds so I can overwrite old backup after a while, what is best way of
82 > > ensuring the integrity and safety of them. Is it a good idea to use
83 > > truecrypt containers? Or nothing tops signing and encrypting with gpg?
84 >
85 > I'd use DVD-RAM. The media is a little more expensive, but AFAIK they
86 > were made with long-time backups in mind. And access is much easier,
87 > you just copy the files as to an external drive, no need to burn ISOs.
88 >
89 > Wonko
90 >
91 >
92 Thanks for the advises.