]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.mount.xml
tmpfiles: fix compilation without acl support
[thirdparty/systemd.git] / man / systemd.mount.xml
CommitLineData
cdb788e4
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5
6<!--
7 This file is part of systemd.
8
9 Copyright 2010 Lennart Poettering
10
11 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
cdb788e4
LP
14 (at your option) any later version.
15
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 19 Lesser General Public License for more details.
cdb788e4 20
5430f7f2 21 You should have received a copy of the GNU Lesser General Public License
cdb788e4
LP
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23-->
24
25<refentry id="systemd.mount">
26 <refentryinfo>
27 <title>systemd.mount</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>systemd.mount</refentrytitle>
42 <manvolnum>5</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>systemd.mount</refname>
34511ca7 47 <refpurpose>Mount unit configuration</refpurpose>
cdb788e4
LP
48 </refnamediv>
49
50 <refsynopsisdiv>
e670b166 51 <para><filename><replaceable>mount</replaceable>.mount</filename></para>
cdb788e4
LP
52 </refsynopsisdiv>
53
54 <refsect1>
55 <title>Description</title>
56
57 <para>A unit configuration file whose name ends in
479fe882 58 <literal>.mount</literal> encodes information about
65232ea7
LP
59 a file system mount point controlled and supervised by
60 systemd.</para>
cdb788e4
LP
61
62 <para>This man page lists the configuration options
63 specific to this unit type. See
64 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
65 for the common options of all unit configuration
66 files. The common configuration items are configured
67 in the generic [Unit] and [Install] sections. The
68 mount specific configuration options are configured
69 in the [Mount] section.</para>
70
71 <para>Additional options are listed in
ba60f905
LP
72 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
73 which define the execution environment the
74 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
4819ff03 75 binary is executed in, and in
d868475a
ZJS
76 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
77 which define the way the processes are terminated, and
78 in
3fde5f30
LP
79 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
80 which configure resource control settings for the
d868475a
ZJS
81 processes of the service. Note that the User= and
82 Group= options are not particularly useful for mount
83 units specifying a <literal>Type=</literal> option or
84 using configuration not specified in
85 <filename>/etc/fstab</filename>;
8a117511 86 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
6b4991cf 87 will refuse options that are not listed in
8a117511
LP
88 <filename>/etc/fstab</filename> if it is not run as
89 UID 0.</para>
cdb788e4 90
e0cabd4b
LP
91 <para>Mount units must be named after the mount point
92 directories they control. Example: the mount point
845c5324 93 <filename noindex='true'>/home/lennart</filename> must be configured
cdb788e4
LP
94 in a unit file
95 <filename>home-lennart.mount</filename>. For details
96 about the escaping logic used to convert a file system
b040723e 97 path to a unit name, see
cdb788e4 98 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
65232ea7
LP
99
100 <para>Optionally, a mount unit may be accompanied by
101 an automount unit, to allow on-demand or parallelized
102 mounting. See
103 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
e0cabd4b 104
f848f8d8 105 <para>If a mount point is beneath another mount point
b439c6ee 106 in the file system hierarchy, a dependency between both
e0cabd4b 107 units is created automatically.</para>
b36b082c 108
236bc757
LP
109 <para>Mount points created at runtime (independently of
110 unit files or <filename>/etc/fstab</filename>) will be
b36b082c 111 monitored by systemd and appear like any other mount
e22ac43b
ZJS
112 unit in systemd.
113 See <filename>/proc/self/mountinfo</filename> description
5aded369 114 in <citerefentry project='man-pages'><refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
e22ac43b 115 </para>
236bc757
LP
116
117 <para>Some file systems have special semantics as API
118 file systems for kernel-to-userspace and
119 userspace-to-userpace interfaces. Some of them may not
120 be changed via mount units, and cannot be disabled.
121 For a longer discussion see <ulink
122 url="http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems">API
123 File Systems</ulink>.</para>
cdb788e4
LP
124 </refsect1>
125
126 <refsect1>
5607d856 127 <title><filename>fstab</filename></title>
cdb788e4
LP
128
129 <para>Mount units may either be configured via unit
130 files, or via <filename>/etc/fstab</filename> (see
131 <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
059b37cc
LP
132 for details). Mounts listed in
133 <filename>/etc/fstab</filename> will be converted into
134 native units dynamically at boot and when the
72ebbf34
ZJS
135 configuration of the system manager is reloaded. In
136 general, configuring mount points through
137 <filename>/etc/fstab</filename> is the preferred
138 approach. See
059b37cc
LP
139 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
140 for details about the conversion.</para>
cdb788e4
LP
141
142 <para>When reading <filename>/etc/fstab</filename> a
143 few special mount options are understood by systemd
144 which influence how dependencies are created for mount
5607d856 145 points. systemd will create a dependency of type
63b03c0b
ZJS
146 <option>Wants</option> or <option>Requires</option>
147 (see option <option>nofail</option> below), from
148 either <filename>local-fs.target</filename> or
cdb788e4 149 <filename>remote-fs.target</filename>, depending
63b03c0b
ZJS
150 whether the file system is local or remote.</para>
151
152 <variablelist class='fstab-options'>
153
154 <varlistentry>
155 <term><option>x-systemd.automount</option></term>
156
157 <listitem><para>An automount unit will be created
158 for the file system. See
159 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
160 for details.</para></listitem>
161 </varlistentry>
162
163 <varlistentry>
164 <term><option>x-systemd.device-timeout=</option></term>
165
166 <listitem><para>Configure how long systemd should
167 wait for a device to show up before giving up on
168 an entry from
169 <filename>/etc/fstab</filename>. Specify a time in
170 seconds or explicitly append a unit as
171 <literal>s</literal>, <literal>min</literal>,
172 <literal>h</literal>,
173 <literal>ms</literal>.</para>
174
175 <para>Note that this option can only be used in
176 <filename>/etc/fstab</filename>, and will be
177 ignored when part of <varname>Options=</varname>
178 setting in a unit file.</para>
179 </listitem>
180 </varlistentry>
181
63b03c0b
ZJS
182 <varlistentry>
183 <term><option>noauto</option></term>
184 <term><option>auto</option></term>
185
186 <listitem><para>With <option>noauto</option>, this
187 mount will not be added as a dependency for
5607d856
ZJS
188 <filename>local-fs.target</filename> or
189 <filename>remote-fs.target</filename>. This means
63b03c0b
ZJS
190 that it will not be mounted automatically during
191 boot, unless it is pulled in by some other
192 unit. Option <option>auto</option> has the
193 opposite meaning and is the default.</para>
194 </listitem>
195 </varlistentry>
ee43f49b 196
5607d856
ZJS
197 <varlistentry>
198 <term><option>nofail</option></term>
5607d856
ZJS
199
200 <listitem><para>With <option>nofail</option> this
201 mount will be only wanted, not required, by
202 <filename>local-fs.target</filename> or
203 <filename>remote-fs.target</filename>. This means
204 that the boot will continue even if this mount
deb61209 205 point is not mounted successfully.</para>
5607d856
ZJS
206 </listitem>
207 </varlistentry>
208
ee43f49b
ZJS
209 <varlistentry>
210 <term><option>x-initrd.mount</option></term>
211
212 <listitem><para>An additional filesystem to be
213 mounted in the initramfs. See
214 <filename>initrd-fs.target</filename> description
215 in
216 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
217 </para></listitem>
218 </varlistentry>
63b03c0b 219 </variablelist>
72ebbf34 220
cdb788e4 221 <para>If a mount point is configured in both
c32247e9 222 <filename>/etc/fstab</filename> and a unit file that
79640424 223 is stored below <filename>/usr</filename>, the former
c32247e9 224 will take precedence. If the unit file is stored below
79640424 225 <filename>/etc</filename>, it will take
c32247e9
LP
226 precedence. This means: native unit files take
227 precedence over traditional configuration files, but
228 this is superseded by the rule that configuration in
229 <filename>/etc</filename> will always take precedence
230 over configuration in
231 <filename>/usr</filename>.</para>
cdb788e4
LP
232 </refsect1>
233
234 <refsect1>
235 <title>Options</title>
236
237 <para>Mount files must include a [Mount] section,
238 which carries information about the file system mount points it
239 supervises. A number of options that may be used in
240 this section are shared with other unit types. These
241 options are documented in
4819ff03
LP
242 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
243 and
244 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
65232ea7 245 options specific to the [Mount] section of mount
cdb788e4
LP
246 units are the following:</para>
247
ccc9a4f9 248 <variablelist class='unit-directives'>
cdb788e4
LP
249
250 <varlistentry>
251 <term><varname>What=</varname></term>
252 <listitem><para>Takes an absolute path
253 of a device node, file or other
254 resource to mount. See
255 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
256 for details. If this refers to a
b439c6ee 257 device node, a dependency on the
cdb788e4
LP
258 respective device unit is
259 automatically created. (See
260 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.)
261 This option is
262 mandatory.</para></listitem>
263 </varlistentry>
264
265 <varlistentry>
266 <term><varname>Where=</varname></term>
267 <listitem><para>Takes an absolute path
268 of a directory of the mount point. If
f848f8d8 269 the mount point does not exist at the
b439c6ee 270 time of mounting, it is created. This
cdb788e4 271 string must be reflected in the unit
e9dd9f95 272 filename. (See above.) This option is
cdb788e4
LP
273 mandatory.</para></listitem>
274 </varlistentry>
275
276 <varlistentry>
277 <term><varname>Type=</varname></term>
278 <listitem><para>Takes a string for the
e9dd9f95 279 file system type. See
cdb788e4
LP
280 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
281 for details. This setting is
282 optional.</para></listitem>
283 </varlistentry>
284
285 <varlistentry>
286 <term><varname>Options=</varname></term>
287
288 <listitem><para>Mount options to use
e9dd9f95
JSJ
289 when mounting. This takes a
290 comma-separated list of options. This
cdb788e4
LP
291 setting is optional.</para></listitem>
292 </varlistentry>
293
294 <varlistentry>
2dbd4a94
LP
295 <term><varname>SloppyOptions=</varname></term>
296
297 <listitem><para>Takes a boolean
8d0e0ddd 298 argument. If true, parsing of the
2dbd4a94
LP
299 options specified in
300 <varname>Options=</varname> is
301 relaxed, and unknown mount options are
302 tolerated. This corresponds with
303 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
304 <parameter>-s</parameter>
305 switch. Defaults to
306 off.</para></listitem>
307 </varlistentry>
308
309 <varlistentry>
cdb788e4
LP
310 <term><varname>DirectoryMode=</varname></term>
311 <listitem><para>Directories of mount
312 points (and any parent directories)
313 are automatically created if
314 needed. This option specifies the file
315 system access mode used when creating
dd1eb43b
LP
316 these directories. Takes an access
317 mode in octal notation. Defaults to
cdb788e4
LP
318 0755.</para></listitem>
319 </varlistentry>
320
321 <varlistentry>
322 <term><varname>TimeoutSec=</varname></term>
323 <listitem><para>Configures the time to
324 wait for the mount command to
b439c6ee 325 finish. If a command does not exit
e9dd9f95 326 within the configured time, the mount
cdb788e4
LP
327 will be considered failed and be shut
328 down again. All commands still running
329 will be terminated forcibly via
05cc7267
ZJS
330 <constant>SIGTERM</constant>, and after another delay of
331 this time with <constant>SIGKILL</constant>. (See
4819ff03
LP
332 <option>KillMode=</option> in
333 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.)
cdb788e4
LP
334 Takes a unit-less value in seconds, or
335 a time span value such as "5min
336 20s". Pass 0 to disable the timeout
63ba209d
JE
337 logic. The default value is set from the manager configuration
338 file's <varname>DefaultTimeoutStart=</varname> variable.</para></listitem>
cdb788e4 339 </varlistentry>
c485d3ba 340 </variablelist>
4819ff03
LP
341
342 <para>Check
343 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
344 and
345 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>
346 for more settings.</para>
c485d3ba
LP
347 </refsect1>
348
cdb788e4
LP
349 <refsect1>
350 <title>See Also</title>
351 <para>
f3e219a2 352 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
67826132 353 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
cdb788e4
LP
354 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
355 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
4819ff03 356 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
3fde5f30 357 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
66b1a247 358 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
cdb788e4 359 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
5aded369 360 <citerefentry project='man-pages'><refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
059b37cc 361 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
9cc2c8b7
ZJS
362 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
363 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
cdb788e4
LP
364 </para>
365 </refsect1>
366
367</refentry>