]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.mount.xml
b8d4f372810aa02ae610c867f7460bcc84cab80c
[thirdparty/systemd.git] / man / systemd.mount.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="systemd.mount" xmlns:xi="http://www.w3.org/2001/XInclude">
7 <refentryinfo>
8 <title>systemd.mount</title>
9 <productname>systemd</productname>
10 </refentryinfo>
11
12 <refmeta>
13 <refentrytitle>systemd.mount</refentrytitle>
14 <manvolnum>5</manvolnum>
15 </refmeta>
16
17 <refnamediv>
18 <refname>systemd.mount</refname>
19 <refpurpose>Mount unit configuration</refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23 <para><filename><replaceable>mount</replaceable>.mount</filename></para>
24 </refsynopsisdiv>
25
26 <refsect1>
27 <title>Description</title>
28
29 <para>A unit configuration file whose name ends in
30 <literal>.mount</literal> encodes information about a file system
31 mount point controlled and supervised by systemd.</para>
32
33 <para>This man page lists the configuration options specific to
34 this unit type. See
35 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
36 for the common options of all unit configuration files. The common
37 configuration items are configured in the generic [Unit] and
38 [Install] sections. The mount specific configuration options are
39 configured in the [Mount] section.</para>
40
41 <para>Additional options are listed in
42 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
43 which define the execution environment the
44 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
45 program is executed in, and in
46 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
47 which define the way the processes are terminated, and in
48 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
49 which configure resource control settings for the processes of the
50 service.</para>
51
52 <para>Note that the options <varname>User=</varname> and
53 <varname>Group=</varname> are not useful for mount units.
54 systemd passes two parameters to
55 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>;
56 the values of <varname>What=</varname> and <varname>Where=</varname>.
57 When invoked in this way,
58 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
59 does not read any options from <filename>/etc/fstab</filename>, and
60 must be run as UID 0.</para>
61
62 <para>Mount units must be named after the mount point directories they control. Example: the mount point
63 <filename index="false">/home/lennart</filename> must be configured in a unit file
64 <filename>home-lennart.mount</filename>. For details about the escaping logic used to convert a file
65 system path to a unit name, see
66 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note
67 that mount units cannot be templated, nor is possible to add multiple names to a mount unit by creating
68 symlinks to its unit file.</para>
69
70 <para>Optionally, a mount unit may be accompanied by an automount
71 unit, to allow on-demand or parallelized mounting. See
72 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
73
74 <para>Mount points created at runtime (independently of unit files
75 or <filename>/etc/fstab</filename>) will be monitored by systemd
76 and appear like any other mount unit in systemd. See
77 <filename>/proc/self/mountinfo</filename> description in
78 <citerefentry project='man-pages'><refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
79 </para>
80
81 <para>Some file systems have special semantics as API file systems
82 for kernel-to-userspace and userspace-to-userspace interfaces. Some
83 of them may not be changed via mount units, and cannot be
84 disabled. For a longer discussion see <ulink
85 url="https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems">API
86 File Systems</ulink>.</para>
87
88 <para>The
89 <citerefentry><refentrytitle>systemd-mount</refentrytitle><manvolnum>1</manvolnum></citerefentry> command
90 allows creating <filename>.mount</filename> and <filename>.automount</filename> units dynamically and
91 transiently from the command line.</para>
92 </refsect1>
93
94 <refsect1>
95 <title>Automatic Dependencies</title>
96
97 <refsect2>
98 <title>Implicit Dependencies</title>
99
100 <para>The following dependencies are implicitly added:</para>
101
102 <itemizedlist>
103 <listitem><para>If a mount unit is beneath another mount unit in the file
104 system hierarchy, both a requirement dependency and an ordering
105 dependency between both units are created automatically.</para></listitem>
106
107 <listitem><para>Block device backed file systems automatically gain <varname>Requires=</varname>,
108 <varname>StopPropagatedFrom=</varname>, and <varname>After=</varname> type dependencies on the
109 device unit encapsulating the block device (see <varname>x-systemd.device-bound=</varname> for details).
110 </para></listitem>
111
112 <listitem><para>If traditional file system quota is enabled for a mount unit, automatic
113 <varname>Wants=</varname> and <varname>Before=</varname> dependencies on
114 <filename>systemd-quotacheck.service</filename> and <filename>quotaon.service</filename>
115 are added.</para></listitem>
116
117 <listitem><para>Additional implicit dependencies may be added as result of execution and
118 resource control parameters as documented in
119 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
120 and
121 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
122 </para></listitem>
123 </itemizedlist>
124 </refsect2>
125
126 <refsect2>
127 <title>Default Dependencies</title>
128
129 <para>The following dependencies are added unless <varname>DefaultDependencies=no</varname> is set:</para>
130
131 <itemizedlist>
132 <listitem><para>All mount units acquire automatic <varname>Before=</varname> and <varname>Conflicts=</varname> on
133 <filename>umount.target</filename> in order to be stopped during shutdown.</para></listitem>
134
135 <listitem><para>Mount units referring to local file systems automatically gain
136 an <varname>After=</varname> dependency on <filename>local-fs-pre.target</filename>, and a
137 <varname>Before=</varname> dependency on <filename>local-fs.target</filename> unless one or more
138 mount options among <option>nofail</option>, <option>x-systemd.wanted-by=</option>,
139 and <option>x-systemd.required-by=</option> is set. See below for detailed information.
140 </para></listitem>
141
142 <listitem><para>Network mount units automatically acquire <varname>After=</varname> dependencies on
143 <filename>remote-fs-pre.target</filename>, <filename>network.target</filename>,
144 plus <varname>After=</varname> and <varname>Wants=</varname> dependencies on <filename>network-online.target</filename>,
145 and a <varname>Before=</varname> dependency on <filename>remote-fs.target</filename>, unless
146 one or more mount options among <option>nofail</option>, <option>x-systemd.wanted-by=</option>,
147 and <option>x-systemd.required-by=</option> is set.</para></listitem>
148 </itemizedlist>
149
150 <para>Mount units referring to local and network file systems are distinguished by their file system type
151 specification. In some cases this is not sufficient (for example network block device based mounts, such as
152 iSCSI), in which case <option>_netdev</option> may be added to the mount option string of the unit, which forces
153 systemd to consider the mount unit a network mount.</para>
154 </refsect2>
155 </refsect1>
156
157 <refsect1>
158 <title><filename>fstab</filename></title>
159
160 <para>Mount units may either be configured via unit files, or via <filename>/etc/fstab</filename> (see
161 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
162 for details). Mounts listed in <filename>/etc/fstab</filename> will be converted into native units
163 dynamically at boot and when the configuration of the system manager is reloaded. In general, configuring
164 mount points through <filename>/etc/fstab</filename> is the preferred approach to manage mounts for
165 humans. For tooling, writing mount units should be preferred over editing <filename>/etc/fstab</filename>.
166 See <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
167 for details about the conversion from <filename>/etc/fstab</filename> to mount units.</para>
168
169 <para>The NFS mount option <option>bg</option> for NFS background mounts
170 as documented in <citerefentry project='man-pages'><refentrytitle>nfs</refentrytitle><manvolnum>5</manvolnum></citerefentry>
171 is detected by <command>systemd-fstab-generator</command> and the options
172 are transformed so that systemd fulfills the job-control implications of
173 that option. Specifically <command>systemd-fstab-generator</command> acts
174 as though <literal>x-systemd.mount-timeout=infinity,retry=10000</literal> was
175 prepended to the option list, and <literal>fg,nofail</literal> was appended.
176 Depending on specific requirements, it may be appropriate to provide some of
177 these options explicitly, or to make use of the
178 <literal>x-systemd.automount</literal> option described below instead
179 of using <literal>bg</literal>.</para>
180
181 <para>When reading <filename>/etc/fstab</filename> a few special
182 mount options are understood by systemd which influence how
183 dependencies are created for mount points. systemd will create a
184 dependency of type <varname>Wants=</varname> or
185 <option>Requires=</option> (see option <option>nofail</option>
186 below), from either <filename>local-fs.target</filename> or
187 <filename>remote-fs.target</filename>, depending whether the file
188 system is local or remote.</para>
189
190 <variablelist class='fstab-options'>
191
192 <varlistentry>
193 <term><option>x-systemd.requires=</option></term>
194
195 <listitem><para>Configures a <varname>Requires=</varname> and
196 an <varname>After=</varname> dependency between the created
197 mount unit and another systemd unit, such as a device or mount
198 unit. The argument should be a unit name, or an absolute path
199 to a device node or mount point. This option may be specified
200 more than once. This option is particularly useful for mount
201 point declarations that need an additional device to be around
202 (such as an external journal device for journal file systems)
203 or an additional mount to be in place (such as an overlay file
204 system that merges multiple mount points). See
205 <varname>After=</varname> and <varname>Requires=</varname> in
206 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
207 for details.</para>
208
209 <para>Note that this option always applies to the created mount unit
210 only regardless whether <option>x-systemd.automount</option> has been
211 specified.</para>
212
213 <xi:include href="version-info.xml" xpointer="v220"/></listitem>
214 </varlistentry>
215
216 <varlistentry>
217 <term><option>x-systemd.before=</option></term>
218 <term><option>x-systemd.after=</option></term>
219
220 <listitem><para>In the created mount unit, configures a
221 <varname>Before=</varname> or <varname>After=</varname>
222 dependency on another systemd unit, such as a mount unit.
223 The argument should be a unit name or an absolute path
224 to a mount point. This option may be specified more than once.
225 This option is particularly useful for mount point declarations
226 with <option>nofail</option> option that are mounted
227 asynchronously but need to be mounted before or after some unit
228 start, for example, before <filename>local-fs.target</filename>
229 unit.
230 See <varname>Before=</varname> and <varname>After=</varname> in
231 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
232 for details.</para>
233
234 <para>Note that these options always apply to the created mount unit
235 only regardless whether <option>x-systemd.automount</option> has been
236 specified.</para>
237
238 <xi:include href="version-info.xml" xpointer="v233"/></listitem>
239 </varlistentry>
240
241 <varlistentry>
242 <term><option>x-systemd.wanted-by=</option></term>
243 <term><option>x-systemd.required-by=</option></term>
244
245 <listitem><para>In the created mount unit, configures a <varname>WantedBy=</varname> or
246 <varname>RequiredBy=</varname> dependency on another unit. This option may be specified more than once.
247 If this is specified, the default dependencies (see above) other than <filename>umount.target</filename>
248 on the created mount unit, e.g. <filename>local-fs.target</filename>, are not automatically created.
249 Hence it is likely that some ordering dependencies need to be set up manually through
250 <option>x-systemd.before=</option> and <option>x-systemd.after=</option>. See <varname>WantedBy=</varname>
251 and <varname>RequiredBy=</varname> in
252 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
253 for details.</para>
254
255 <xi:include href="version-info.xml" xpointer="v245"/></listitem>
256 </varlistentry>
257
258 <varlistentry>
259 <term><option>x-systemd.wants-mounts-for=</option></term>
260 <term><option>x-systemd.requires-mounts-for=</option></term>
261
262 <listitem><para>Configures a
263 <varname>RequiresMountsFor=</varname> or <varname>WantsMountsFor=</varname>
264 dependency between the created mount unit and other mount units. The
265 argument must be an absolute path. This option may be specified more than
266 once. See <varname>RequiresMountsFor=</varname> or <varname>WantsMountsFor=</varname> in
267 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
268 for details.</para>
269
270 <xi:include href="version-info.xml" xpointer="v220"/></listitem>
271 </varlistentry>
272
273 <varlistentry>
274 <term><option>x-systemd.device-bound=</option></term>
275
276 <listitem><para>Takes a boolean argument. If true or no argument, a <varname>BindsTo=</varname> dependency
277 on the backing device is set. If false, the mount unit is not stopped no matter whether the backing device
278 is still present. This is useful when the file system is backed by volume managers. If not set, and the mount
279 comes from unit fragments, i.e. generated from <filename>/etc/fstab</filename> by <citerefentry>
280 <refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry> or loaded from
281 a manually configured mount unit, a combination of <varname>Requires=</varname> and <varname>StopPropagatedFrom=</varname>
282 dependencies is set on the backing device. If doesn't, only <varname>Requires=</varname> is used.</para>
283
284 <xi:include href="version-info.xml" xpointer="v233"/></listitem>
285 </varlistentry>
286
287 <varlistentry>
288 <term><option>x-systemd.automount</option></term>
289
290 <listitem><para>An automount unit will be created for the file
291 system. See
292 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
293 for details.</para>
294
295 <xi:include href="version-info.xml" xpointer="v215"/></listitem>
296 </varlistentry>
297
298 <varlistentry>
299 <term><option>x-systemd.idle-timeout=</option></term>
300
301 <listitem><para>Configures the idle timeout of the
302 automount unit. See <varname>TimeoutIdleSec=</varname> in
303 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
304 for details.</para>
305
306 <xi:include href="version-info.xml" xpointer="v220"/></listitem>
307 </varlistentry>
308
309 <varlistentry id='device-timeout'>
310 <term><option>x-systemd.device-timeout=</option></term>
311
312 <listitem><para>Configure how long systemd should wait for a
313 device to show up before giving up on an entry from
314 <filename>/etc/fstab</filename>. Specify a time in seconds or
315 explicitly append a unit such as <literal>s</literal>,
316 <literal>min</literal>, <literal>h</literal>,
317 <literal>ms</literal>.</para>
318
319 <para>Note that this option can only be used in
320 <filename>/etc/fstab</filename>, and will be
321 ignored when part of the <varname>Options=</varname>
322 setting in a unit file.</para>
323
324 <xi:include href="version-info.xml" xpointer="v215"/>
325 </listitem>
326 </varlistentry>
327
328 <varlistentry>
329 <term><option>x-systemd.mount-timeout=</option></term>
330
331 <listitem><para>Configure how long systemd should wait for the
332 mount command to finish before giving up on an entry from
333 <filename>/etc/fstab</filename>. Specify a time in seconds or
334 explicitly append a unit such as <literal>s</literal>,
335 <literal>min</literal>, <literal>h</literal>,
336 <literal>ms</literal>.</para>
337
338 <para>Note that this option can only be used in
339 <filename>/etc/fstab</filename>, and will be
340 ignored when part of the <varname>Options=</varname>
341 setting in a unit file.</para>
342
343 <para>See <varname>TimeoutSec=</varname> below for
344 details.</para>
345
346 <xi:include href="version-info.xml" xpointer="v233"/>
347 </listitem>
348 </varlistentry>
349
350 <varlistentry>
351 <term><option>x-systemd.makefs</option></term>
352
353 <listitem><para>The file system will be initialized
354 on the device. If the device is not "empty", i.e. it contains any signature,
355 the operation will be skipped. It is hence expected that this option
356 remains set even after the device has been initialized.</para>
357
358 <para>Note that this option can only be used in
359 <filename>/etc/fstab</filename>, and will be ignored when part of the
360 <varname>Options=</varname> setting in a unit file.</para>
361
362 <para>See
363 <citerefentry><refentrytitle>systemd-makefs@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
364 </para>
365
366 <para><citerefentry project='man-pages'><refentrytitle>wipefs</refentrytitle><manvolnum>8</manvolnum></citerefentry>
367 may be used to remove any signatures from a block device to force
368 <option>x-systemd.makefs</option> to reinitialize the device.</para>
369
370 <xi:include href="version-info.xml" xpointer="v236"/>
371 </listitem>
372 </varlistentry>
373
374 <varlistentry>
375 <term><option>x-systemd.growfs</option></term>
376
377 <listitem><para>The file system will be grown to occupy the full block
378 device. If the file system is already at maximum size, no action will
379 be performed. It is hence expected that this option remains set even after
380 the file system has been grown. Only certain file system types are supported,
381 see
382 <citerefentry><refentrytitle>systemd-makefs@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
383 for details.</para>
384
385 <para>Note that this option can only be used in
386 <filename>/etc/fstab</filename>, and will be ignored when part of the
387 <varname>Options=</varname> setting in a unit file.</para>
388
389 <xi:include href="version-info.xml" xpointer="v236"/></listitem>
390 </varlistentry>
391
392 <varlistentry>
393 <term><option>x-systemd.pcrfs</option></term>
394
395 <listitem><para>Measures file system identity information (mount point, type, label, UUID, partition
396 label, partition UUID) into PCR 15 after the file system has been mounted. This ensures the
397 <citerefentry><refentrytitle>systemd-pcrfs@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
398 or <filename>systemd-pcrfs-root.service</filename> services are pulled in by the mount unit.</para>
399
400 <para>Note that this option can only be used in <filename>/etc/fstab</filename>, and will be ignored
401 when part of the <varname>Options=</varname> setting in a unit file. It is also implied for the root
402 and <filename>/usr/</filename> partitions discovered by
403 <citerefentry><refentrytitle>systemd-gpt-auto-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
404
405 <xi:include href="version-info.xml" xpointer="v253"/></listitem>
406 </varlistentry>
407
408 <varlistentry>
409 <term><option>x-systemd.rw-only</option></term>
410
411 <listitem><para>If a mount operation fails to mount the file system
412 read-write, it normally tries mounting the file system read-only instead.
413 This option disables that behaviour, and causes the mount to fail
414 immediately instead. This option is translated into the
415 <varname>ReadWriteOnly=</varname> setting in a unit file.</para>
416
417 <xi:include href="version-info.xml" xpointer="v246"/>
418 </listitem>
419 </varlistentry>
420
421 <varlistentry>
422 <term><option>_netdev</option></term>
423
424 <listitem><para>Normally the file system type is used to determine if a
425 mount is a "network mount", i.e. if it should only be started after the
426 network is available. Using this option overrides this detection and
427 specifies that the mount requires network.</para>
428
429 <para>Network mount units are ordered between <filename>remote-fs-pre.target</filename>
430 and <filename>remote-fs.target</filename>, instead of
431 <filename>local-fs-pre.target</filename> and <filename>local-fs.target</filename>.
432 They also pull in <filename>network-online.target</filename> and are ordered after
433 it and <filename>network.target</filename>.</para>
434
435 <xi:include href="version-info.xml" xpointer="v235"/>
436 </listitem>
437 </varlistentry>
438
439 <varlistentry>
440 <term><option>noauto</option></term>
441 <term><option>auto</option></term>
442
443 <listitem><para>With <option>noauto</option>, the mount unit will not be added as a dependency for
444 <filename>local-fs.target</filename> or <filename>remote-fs.target</filename>. This means that it
445 will not be mounted automatically during boot, unless it is pulled in by some other unit. The
446 <option>auto</option> option has the opposite meaning and is the default.</para>
447
448 <para>Note that if <option>x-systemd.automount</option> (see above) is used, neither
449 <option>auto</option> nor <option>noauto</option> have any effect. The matching automount unit will
450 be added as a dependency to the appropriate target.</para>
451
452 <xi:include href="version-info.xml" xpointer="v215"/>
453 </listitem>
454 </varlistentry>
455
456 <varlistentry>
457 <term><option>nofail</option></term>
458
459 <listitem><para>With <option>nofail</option>, this mount will be only wanted, not required, by
460 <filename>local-fs.target</filename> or <filename>remote-fs.target</filename>. Moreover the mount unit is not
461 ordered before these target units. This means that the boot will continue without waiting for the mount unit
462 and regardless whether the mount point can be mounted successfully.</para>
463
464 <xi:include href="version-info.xml" xpointer="v215"/>
465 </listitem>
466 </varlistentry>
467
468 <varlistentry>
469 <term><option>x-initrd.mount</option></term>
470
471 <listitem><para>An additional filesystem to be mounted in the initrd. See
472 <filename>initrd-fs.target</filename> description in
473 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>. This
474 is both an indicator to the initrd to mount this partition early and an indicator to the host to
475 leave the partition mounted until final shutdown. Or in other words, if this flag is set it is
476 assumed the mount shall be active during the entire regular runtime of the system, i.e. established
477 before the initrd transitions into the host all the way until the host transitions to the final
478 shutdown phase.</para>
479
480 <xi:include href="version-info.xml" xpointer="v215"/></listitem>
481 </varlistentry>
482 </variablelist>
483
484 <para>If a mount point is configured in both
485 <filename>/etc/fstab</filename> and a unit file that is stored
486 below <filename>/usr/</filename>, the former will take precedence.
487 If the unit file is stored below <filename>/etc/</filename>, it
488 will take precedence. This means: native unit files take
489 precedence over traditional configuration files, but this is
490 superseded by the rule that configuration in
491 <filename>/etc/</filename> will always take precedence over
492 configuration in <filename>/usr/</filename>.</para>
493 </refsect1>
494
495 <refsect1>
496 <title>Options</title>
497
498 <para>Mount unit files may include [Unit] and [Install] sections, which are described in
499 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
500 </para>
501
502 <para>Mount unit files must include a [Mount] section, which carries
503 information about the file system mount points it supervises. A
504 number of options that may be used in this section are shared with
505 other unit types. These options are documented in
506 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
507 and
508 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
509 The options specific to the [Mount] section of mount units are the
510 following:</para>
511
512 <variablelist class='unit-directives'>
513
514 <varlistentry>
515 <term><varname>What=</varname></term>
516 <listitem><para>Takes an absolute path of a device node, file or other resource to mount. See
517 <citerefentry
518 project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> for
519 details. If this refers to a device node, a dependency on the respective device unit is automatically
520 created. (See
521 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>
522 for more information.) This option is mandatory. Note that the usual specifier expansion is applied
523 to this setting, literal percent characters should hence be written as <literal
524 class='specifiers'>%%</literal>. If this mount is a bind mount and the specified path does not exist
525 yet it is created as directory.</para></listitem>
526 </varlistentry>
527
528 <varlistentry>
529 <term><varname>Where=</varname></term>
530 <listitem><para>Takes an absolute path of a file or directory for the mount point; in particular, the
531 destination cannot be a symbolic link. If the mount point does not exist at the time of mounting, it
532 is created as either a directory or a file. The former is the usual case; the latter is done only if this mount
533 is a bind mount and the source (<varname>What=</varname>) is not a directory.
534 This string must be reflected in the unit filename. (See above.) This option
535 is mandatory.</para></listitem>
536 </varlistentry>
537
538 <varlistentry>
539 <term><varname>Type=</varname></term>
540 <listitem><para>Takes a string for the file system type. See
541 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
542 for details. This setting is optional.</para>
543
544 <para>If the type is <literal>overlay</literal>, and <literal>upperdir=</literal> or
545 <literal>workdir=</literal> are specified as options and they don't exist, they will be created.
546 </para></listitem>
547 </varlistentry>
548
549 <varlistentry>
550 <term><varname>Options=</varname></term>
551
552 <listitem><para>Mount options to use when mounting. This takes a comma-separated list of options. This setting
553 is optional. Note that the usual specifier expansion is applied to this setting, literal percent characters
554 should hence be written as <literal class='specifiers'>%%</literal>.</para></listitem>
555 </varlistentry>
556
557 <varlistentry>
558 <term><varname>SloppyOptions=</varname></term>
559
560 <listitem><para>Takes a boolean argument. If true, parsing of
561 the options specified in <varname>Options=</varname> is
562 relaxed, and unknown mount options are tolerated. This
563 corresponds with
564 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
565 <parameter>-s</parameter> switch. Defaults to
566 off.</para>
567
568 <xi:include href="version-info.xml" xpointer="v215"/></listitem>
569 </varlistentry>
570
571 <varlistentry>
572 <term><varname>LazyUnmount=</varname></term>
573
574 <listitem><para>Takes a boolean argument. If true, detach the
575 filesystem from the filesystem hierarchy at time of the unmount
576 operation, and clean up all references to the filesystem as
577 soon as they are not busy anymore.
578 This corresponds with
579 <citerefentry project='man-pages'><refentrytitle>umount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
580 <parameter>-l</parameter> switch. Defaults to
581 off.</para>
582
583 <xi:include href="version-info.xml" xpointer="v232"/></listitem>
584 </varlistentry>
585
586 <varlistentry>
587 <term><varname>ReadWriteOnly=</varname></term>
588
589 <listitem><para>Takes a boolean argument. If false, a mount
590 point that shall be mounted read-write but cannot be mounted
591 so is retried to be mounted read-only. If true the operation
592 will fail immediately after the read-write mount attempt did
593 not succeed. This corresponds with
594 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
595 <parameter>-w</parameter> switch. Defaults to
596 off.</para>
597
598 <xi:include href="version-info.xml" xpointer="v246"/></listitem>
599 </varlistentry>
600
601 <varlistentry>
602 <term><varname>ForceUnmount=</varname></term>
603
604 <listitem><para>Takes a boolean argument. If true, force an
605 unmount (in case of an unreachable NFS system).
606 This corresponds with
607 <citerefentry project='man-pages'><refentrytitle>umount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
608 <parameter>-f</parameter> switch. Defaults to
609 off.</para>
610
611 <xi:include href="version-info.xml" xpointer="v232"/></listitem>
612 </varlistentry>
613
614 <varlistentry>
615 <term><varname>DirectoryMode=</varname></term>
616 <listitem><para>Directories of mount points (and any parent
617 directories) are automatically created if needed. This option
618 specifies the file system access mode used when creating these
619 directories. Takes an access mode in octal notation. Defaults
620 to 0755.</para></listitem>
621 </varlistentry>
622
623 <varlistentry>
624 <term><varname>TimeoutSec=</varname></term>
625 <listitem><para>Configures the time to wait for the mount
626 command to finish. If a command does not exit within the
627 configured time, the mount will be considered failed and be
628 shut down again. All commands still running will be terminated
629 forcibly via <constant>SIGTERM</constant>, and after another
630 delay of this time with <constant>SIGKILL</constant>. (See
631 <option>KillMode=</option> in
632 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.)
633 Takes a unit-less value in seconds, or a time span value such
634 as "5min 20s". Pass 0 to disable the timeout logic. The
635 default value is set from <varname>DefaultTimeoutStartSec=</varname> option in
636 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
637 </para></listitem>
638 </varlistentry>
639 </variablelist>
640
641 <xi:include href="systemd.service.xml" xpointer="shared-unit-options" />
642 </refsect1>
643
644 <refsect1>
645 <title>See Also</title>
646 <para>
647 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
648 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
649 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
650 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
651 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
652 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
653 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
654 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
655 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
656 <citerefentry project='man-pages'><refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
657 <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
658 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
659 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
660 <citerefentry><refentrytitle>systemd-mount</refentrytitle><manvolnum>1</manvolnum></citerefentry>
661 </para>
662 </refsect1>
663
664 </refentry>