Update live-boot(7) man page and add new one for live.persist(5).
[live-boot-grml.git] / manpages / en / live.persist.5
1 .TH LIVE.PERSIST 5 2012\-03\-23 3.0~a25-1 "Debian Live Project"
2
3 .SH NAME
4 \fBlive.persist\fR \- Configuration file for persistent media in
5 live\-boot
6
7 .SH DESCRIPTION
8 If live-boot probes a persistent volume with the label (or GPT name,
9 or file name, but from now on we will just say "label") "custom\-ov",
10 that volume's persistence is fully customizable through the
11 \fBlive.persist\fR file stored on the root of its file system. Any such
12 labeled volume must have such a file, or it will be ignored.
13 .PP
14 The format of \fBlive.persist\fR allow empty lines and lines starting
15 with a "#" (used for comments), both which will be ignored. A so
16 called "custom mount" has the format:
17 .PP
18 .RS
19 \fIDIR\fR [\fIOPTION\fR]...
20 .RE
21 .PP
22 which roughly translates to "make \fIDIR\fR persistent in the way
23 described by the list of \fIOPTION\fRs".
24 .PP
25 For each custom mount \fIDIR\fR must be an absolute path that cannot
26 contain white spaces or the special . and .. path components, and
27 cannot be /live (or any of its sub-directories), or / (for the latter,
28 use "full-ov" persistence instead). Once activated all changes (file
29 deletion, creation and modification) to \fIDIR\fR on the live file
30 system are stored persistently into a path equivalent to \fIDIR\fR on
31 the persistent media, called the source directory. The default way to
32 achieve persistence is to simply bind-mount the corresponding source
33 directory to \fIDIR\fR, but this can be changed through the use of
34 \fIOPTION\fRs.
35 .PP
36 All custom mounts will be done in an order so that no two custom
37 mounts can "hide" each other. For instance, if we have the two
38 \fIDIR\fR:s /a and /a/b it would always be the case that /a is mounted
39 first, then /a/b. This remains true no matter how the lines in
40 \fBlive.persist\fR are ordered, or if several \fBlive.persist\fR files
41 on different persistent media are used at the same time. However, it
42 is forbidden for custom mounts to have their source directory inside
43 the source directory of another custom mount, so the source
44 directories that are auto-created by live-boot does not support
45 "nested" mounts like /a and /a/b on the same media. In this case you
46 must use the \fBsource\fR option (see below) to make sure that they
47 are stored in different source directories.
48 .PP
49 When a source directory doesn't exist on the persistent media for a
50 certain custom mount, it will be created automatically, and
51 permissions and ownership will be optimistically set according to
52 \fIDIR\fR. It will also be bootstrapped by copying the contents of the
53 \fIDIR\fR into its source directory on the persistent media. The
54 bootstrapping will not happen when the \fBlinkfiles\fR or \fBunion\fR
55 options are used (see below).
56
57 .SH OPTIONS
58 Custom mounts defined in \fBlive.persist\fR accept the following
59 options in a coma-separated list:
60 .IP "\fBsource\fR=\fIPATH\fR" 4
61 When given, store the persistent changes into \fIPATH\fR on the
62 persistent media. \fIPATH\fR must be a relative path (w.r.t. the
63 persistent media root) that cannot contain white spaces or the
64 special . or .. path components, with the exception that it can be
65 just . which means the persistent media root. This option is mostly
66 relevant if you want to nest custom mounts, which otherwise would
67 cause errors, or if you want to make the whole media root available
68 (similar to the now deprecated \fBhome-rw\fR type of persistence).
69 .PP
70 The following options will override the default bind-mount behaviour
71 of custom mounts, and are mutually exclusive:
72 .IP "\fBlinkfiles\fR" 4
73 Create the directory structure of the source directory on the
74 persistent media in \fIDIR\fR and create symbolic links from the
75 corresponding place in \fIDIR\fR to each file in the source directory.
76 Existing files or directories with the same name as any link will be
77 overwritten. Note that deleting the links in \fIDIR\fR will only
78 remove the link, not the corresponding file in the source; removed
79 links will reappear after a reboot. To permanently add or delete a
80 file one must do so directly in the source directory.
81 .IP
82 Effectively \fBlinkfiles\fR will make only files already in the source
83 directory persistent, not any other files in \fIDIR\fR. These files
84 must be manually added to the source directory to make use of this
85 option, and they will appear in \fIDIR\fR in addition to files already
86 there. This option is useful when only certain files need to be
87 persistent, not the whole directory they're in, e.g. some
88 configuration files in a user's home directory.
89 .IP "\fBunion\fR" 4
90 Save the rw branch of a union on the persistent media, so only the
91 changes are stored persistently. This can potentially reduce disk
92 usage compared to bind-mounts, and will not hide files added to the
93 read-only media. One caveat is that the union will use \fIDIR\fR from
94 the image's read-only file system, not the real file system root, so
95 files created after boot (e.g. by live-config) will not appear in the
96 union. This option will use the union file system specified by
97 live-boot's \fBunion\fR boot parameter, but is not supported with
98 \fBunion=unionmount\fR.
99
100 .SH DIRECTORIES
101 .IP "\fB/live/persistent\fR" 4
102 All persistent volumes will be mounted here (in a directory
103 corresponding to the device name). The \fBlive.persist\fR file can
104 easily be edited through this mount, as well as any source directories
105 (which is especially practical for custom mounts using the
106 \fBlinkfiles\fR option).
107
108 .SH EXAMPLES
109
110 Let's say we have a persistent volume \fIVOL\fR with the a
111 \fBlive.persist\fR file containing the following four lines (numbered
112 for ease of reference):
113 .TP 7
114 1.
115 /home/user1 linkfiles,source=config-files/user1
116 .TP
117 2.
118 /home/user2 linkfiles,source=config-files/user2
119 .TP
120 3.
121 /home
122 .TP
123 4.
124 /usr union
125 .PP
126 The corresponding source directories are:
127 .TP 7
128 1.
129 \fIVOL\fR/config-files/user1 (but it would be \fIVOL\fR/home/user1
130 without the \fBsource\fR option)
131 .TP
132 2.
133 \fIVOL\fR/config-files/user2 (but it would be \fIVOL\fR/home/user2
134 without the \fBsource\fR option)
135 .TP
136 3.
137 \fIVOL\fR/home
138 .TP
139 4.
140 \fIVOL\fR/usr
141 .PP
142 It was necessary to set the \fBsource\fR options for 1 and 2, since
143 they otherwise would become nested with 3's source, which is illegal.
144 .PP
145 Line 3 will be taken care of before line 1 and 2 in order to prevent
146 custom mounts 1 and 2 from being hidden by 3. When line 3 is handled,
147 \fIVOL\fR/home is simply bind-mounted on /home. To illustrate what
148 happens for lines 1 and 2, let's say that the following files exist:
149 .TP 7
150 a.
151 \fIVOL\fR/config-files/user1/.emacs
152 .TP
153 b.
154 \fIVOL\fR/config-files/user2/.bashrc
155 .TP
156 c.
157 \fIVOL\fR/config-files/user2/.ssh/config
158 .PP
159 Then the following links and directories will be created:
160 .TP 7
161 Link:
162 /home/user1/.emacs -> \fIVOL\fR/config-files/user1/.emacs (from a)
163 .TP
164 Link:
165 /home/user2/.bashrc -> \fIVOL\fR/config-files/user2/.bashrc (from b)
166 .TP
167 Dir:
168 /homea/user2/.ssh (from c)
169 .TP
170 Link:
171 /home/user2/.ssh/config -> \fIVOL\fR/config-files/user2/.ssh/config
172 (from c)
173 .PP
174 One could argue, though, that lines 1 and 2 in the example
175 \fBlive.persist\fR file above are unnecessary since line 3 already
176 would make all of /home persistent. The \fBlinkfiles\fR option is
177 intended for situations where you don't want a complete directory to
178 be persistent, only certain files in it or its sub-directories.
179 .PP
180 Line 4 can be mounted at any time since its \fIDIR\fR (and source
181 directory) is completely disjoint from all the other custom
182 mounts. When mounted, \fIVOL\fR/usr will be the rw branch due to the
183 \fBunion\fR option, and will only contain the difference compared to
184 the underlying read-only file system. Hence packages could be
185 installed into /usr with great space-wise efficiency compared to
186 bind-mounts, since in the latter case all of /usr would have to be
187 copied into \fIVOL\fR/usr during the initial bootstrap.
188
189 .SH SEE ALSO
190 \fIlive\-boot\fR(7)
191 .PP
192 \fIlive\-build\fR(7)
193 .PP
194 \fIlive\-config\fR(7)
195 .PP
196 \fIlive\-tools\fR(7)
197
198 .SH HOMEPAGE
199 More information about live\-boot and the Debian Live project can be
200 found on the homepage at <\fIhttp://live.debian.net/\fR> and in the
201 manual at <\fIhttp://live.debian.net/manual/\fR>.
202
203 .SH BUGS
204 Bugs can be reported by submitting a bugreport for the live\-boot
205 package in the Debian Bug Tracking System at
206 <\fIhttp://bugs.debian.org/\fR> or by writing a mail to the Debian
207 Live mailing list at <\fIdebian-live@lists.debian.org\fR>.
208
209 .SH AUTHOR
210 live\-boot was written by anonym <\fIanonym@lavabit.com\fR> for the
211 Debian project.