File: README.saving

package info (click to toggle)
fakeroot 1.20.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,628 kB
  • ctags: 1,130
  • sloc: sh: 11,765; ansic: 4,701; makefile: 260; perl: 14
file content (70 lines) | stat: -rw-r--r-- 2,724 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
The fakeroot environment can be saved for later use if you use the -s
option to fakeroot. This will not work perfectly, however.

Internally, faked keeps track of all files which have had operations
done on them that the user would not normally be able to do, in order to
fake the effect later.

For example, if you create a device node, faked will actually create an
empty file, but remember that it was a device node (along with the
relevant details) so that if you subsequently do an "ls -l", you'll see
it as a device node.

The save option simply saves this list, so later fakeroot invocations
can restore them.

However, you can manipulate the files saved outside of the fakeroot
environment (for example, you could delete the zero-length file that was
the placeholder for the device node) and fakeroot will not know about it
when it loads up the list again. This will cause the list to leak.

The list cannot easily be verified, either, because it keys things by
inode number, and there is no mechanism to look up anything from one of
those alone. Such verification _could_ be done, but would in theory
require a search through the _entire_ filesystem, every time. This isn't
really acceptable for regular operation, and I don't need such a feature
so I haven't written it. The file format is fairly straightforward and
obvious, however, so if anybody else wants to...  :-)

So, this feature should only be used if you limit everything you do
inside the fakeroot environment to the fakeroot environment. This is
still useful - for example (assuming you have the appropriate key):

$ fakeroot -s backup.environ
# mkdir backup
# cd backup
# export RSYNC_RSH=ssh
# rsync -a root@important.example.com:/ .
[...]
# exit
$

Now, "fakeroot -i backup.environ" will get you exactly what you had
backed up, user and group information, device nodes and everything. Of
course, that information is still faked, but you should be able to
happily rsync it back. This way you only need normal user privileges on
the backup machine. This is great to back up multiple machines without a
compromise affecting the backup machine and thereby compromising all the
other machines you back up as well.

Note that further rsync updates should be done with:

$ fakeroot -i backup.environ -s backup.environ
# cd backup
# export RSYNC_RSH=ssh
# rsync -a root@important.example.com:/ .
[...]
# exit
$

so that further changes are still saved.

In this scenario, the shortcoming will not affect anything, as the only
modification of files which required root (and consequently were faked)
is done inside the environment, and can therefore be tracked and saved.

Have fun!

Robie Basak <robie@principle.co.uk>
Northern Principle Limited
25/3/2003.