]>
Commit | Line | Data |
---|---|---|
cdb788e4 | 1 | <?xml version='1.0'?> <!--*-nxml-*--> |
3a54a157 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
0307f791 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1+ --> |
cdb788e4 LP |
5 | |
6 | <refentry id="systemd.mount"> | |
798d3a52 ZJS |
7 | <refentryinfo> |
8 | <title>systemd.mount</title> | |
9 | <productname>systemd</productname> | |
798d3a52 ZJS |
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 | |
f6275730 PW |
37 | configuration items are configured in the generic <literal>[Unit]</literal> and |
38 | <literal>[Install]</literal> sections. The mount specific configuration options are | |
39 | configured in the <literal>[Mount]</literal> section.</para> | |
798d3a52 ZJS |
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 | |
3ba3a79d | 44 | <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
3f2d1365 | 45 | program is executed in, and in |
798d3a52 ZJS |
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 | |
5e0aff56 AJ |
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, | |
3ba3a79d | 58 | <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
5e0aff56 AJ |
59 | does not read any options from <filename>/etc/fstab</filename>, and |
60 | must be run as UID 0.</para> | |
798d3a52 | 61 | |
f4bf8d2f | 62 | <para>Mount units must be named after the mount point directories they control. Example: the mount point <filename |
b0343f8c | 63 | index="false">/home/lennart</filename> must be configured in a unit file <filename>home-lennart.mount</filename>. |
f4bf8d2f LP |
64 | For details about the escaping logic used to convert a file system path to a unit name, see |
65 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Note that mount | |
66 | units cannot be templated, nor is possible to add multiple names to a mount unit by creating additional symlinks to | |
67 | it.</para> | |
798d3a52 ZJS |
68 | |
69 | <para>Optionally, a mount unit may be accompanied by an automount | |
70 | unit, to allow on-demand or parallelized mounting. See | |
71 | <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> | |
72 | ||
798d3a52 ZJS |
73 | <para>Mount points created at runtime (independently of unit files |
74 | or <filename>/etc/fstab</filename>) will be monitored by systemd | |
75 | and appear like any other mount unit in systemd. See | |
76 | <filename>/proc/self/mountinfo</filename> description in | |
77 | <citerefentry project='man-pages'><refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
78 | </para> | |
79 | ||
80 | <para>Some file systems have special semantics as API file systems | |
ff9b60f3 | 81 | for kernel-to-userspace and userspace-to-userspace interfaces. Some |
798d3a52 ZJS |
82 | of them may not be changed via mount units, and cannot be |
83 | disabled. For a longer discussion see <ulink | |
28a0ad81 | 84 | url="https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems">API |
798d3a52 | 85 | File Systems</ulink>.</para> |
438e6a48 LP |
86 | |
87 | <para>The | |
88 | <citerefentry><refentrytitle>systemd-mount</refentrytitle><manvolnum>1</manvolnum></citerefentry> command | |
89 | allows creating <filename>.mount</filename> and <filename>.automount</filename> units dynamically and | |
90 | transiently from the command line.</para> | |
798d3a52 ZJS |
91 | </refsect1> |
92 | ||
c129bd5d | 93 | <refsect1> |
aed5cb03 ZJS |
94 | <title>Automatic Dependencies</title> |
95 | ||
96 | <refsect2> | |
97 | <title>Implicit Dependencies</title> | |
98 | ||
99 | <para>The following dependencies are implicitly added:</para> | |
100 | ||
101 | <itemizedlist> | |
102 | <listitem><para>If a mount unit is beneath another mount unit in the file | |
103 | system hierarchy, both a requirement dependency and an ordering | |
104 | dependency between both units are created automatically.</para></listitem> | |
105 | ||
106 | <listitem><para>Block device backed file systems automatically gain | |
107 | <varname>BindsTo=</varname> and <varname>After=</varname> type | |
108 | dependencies on the device unit encapsulating the block | |
109 | device (see below).</para></listitem> | |
110 | ||
111 | <listitem><para>If traditional file system quota is enabled for a mount | |
112 | unit, automatic <varname>Wants=</varname> and | |
113 | <varname>Before=</varname> dependencies on | |
114 | <filename>systemd-quotacheck.service</filename> and | |
115 | <filename>quotaon.service</filename> are added.</para></listitem> | |
116 | ||
117 | <listitem><para>Additional implicit dependencies may be added as result of | |
118 | execution and 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 | |
321cd1c1 YW |
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 | |
138 | <option>nofail</option> mount option is set.</para></listitem> | |
aed5cb03 ZJS |
139 | |
140 | <listitem><para>Network mount units | |
141 | automatically acquire <varname>After=</varname> dependencies on <filename>remote-fs-pre.target</filename>, | |
321cd1c1 YW |
142 | <filename>network.target</filename> and <filename>network-online.target</filename>, and gain a |
143 | <varname>Before=</varname> dependency on <filename>remote-fs.target</filename> unless | |
144 | <option>nofail</option> mount option is set. Towards the latter a | |
aed5cb03 ZJS |
145 | <varname>Wants=</varname> unit is added as well.</para></listitem> |
146 | </itemizedlist> | |
147 | ||
148 | <para>Mount units referring to local and network file systems are distinguished by their file system type | |
149 | specification. In some cases this is not sufficient (for example network block device based mounts, such as | |
150 | iSCSI), in which case <option>_netdev</option> may be added to the mount option string of the unit, which forces | |
151 | systemd to consider the mount unit a network mount.</para> | |
152 | </refsect2> | |
c129bd5d LP |
153 | </refsect1> |
154 | ||
798d3a52 ZJS |
155 | <refsect1> |
156 | <title><filename>fstab</filename></title> | |
157 | ||
158 | <para>Mount units may either be configured via unit files, or via | |
159 | <filename>/etc/fstab</filename> (see | |
3ba3a79d | 160 | <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
798d3a52 ZJS |
161 | for details). Mounts listed in <filename>/etc/fstab</filename> |
162 | will be converted into native units dynamically at boot and when | |
163 | the configuration of the system manager is reloaded. In general, | |
164 | configuring mount points through <filename>/etc/fstab</filename> | |
165 | is the preferred approach. See | |
166 | <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
167 | for details about the conversion.</para> | |
168 | ||
773ebc0c | 169 | <para>The NFS mount option <option>bg</option> for NFS background mounts |
0a07667d | 170 | as documented in <citerefentry project='man-pages'><refentrytitle>nfs</refentrytitle><manvolnum>5</manvolnum></citerefentry> |
65e1dee7 N |
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 | |
41fc3fab | 174 | as though <literal>x-systemd.mount-timeout=infinity,retry=10000</literal> was |
65e1dee7 N |
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> | |
773ebc0c | 180 | |
798d3a52 ZJS |
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 | |
c129bd5d | 184 | dependency of type <varname>Wants=</varname> or |
a37ef455 | 185 | <option>Requires=</option> (see option <option>nofail</option> |
798d3a52 ZJS |
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 | ||
3519d230 KZ |
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></listitem> | |
208 | </varlistentry> | |
209 | ||
ae325185 RB |
210 | <varlistentry> |
211 | <term><option>x-systemd.before=</option></term> | |
212 | <term><option>x-systemd.after=</option></term> | |
213 | ||
81248e7f AR |
214 | <listitem><para>In the created mount unit, configures a |
215 | <varname>Before=</varname> or <varname>After=</varname> | |
216 | dependency on another systemd unit, such as a mount unit. | |
ae325185 RB |
217 | The argument should be a unit name or an absolute path |
218 | to a mount point. This option may be specified more than once. | |
219 | This option is particularly useful for mount point declarations | |
220 | with <option>nofail</option> option that are mounted | |
221 | asynchronously but need to be mounted before or after some unit | |
222 | start, for example, before <filename>local-fs.target</filename> | |
223 | unit. | |
224 | See <varname>Before=</varname> and <varname>After=</varname> in | |
225 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
226 | for details.</para></listitem> | |
227 | </varlistentry> | |
228 | ||
be02c1cf AR |
229 | <varlistentry> |
230 | <term><option>x-systemd.wanted-by=</option></term> | |
231 | <term><option>x-systemd.required-by=</option></term> | |
232 | ||
233 | <listitem><para>In the created mount unit, configures a | |
234 | <varname>WantedBy=</varname> or <varname>RequiredBy=</varname> | |
235 | dependency on another unit. This option may be | |
236 | specified more than once. If this is specified, the normal | |
237 | automatic dependencies on the created mount unit, e.g., | |
238 | <filename>local-fs.target</filename>, are not automatically | |
239 | created. See <varname>WantedBy=</varname> and <varname>RequiredBy=</varname> in | |
240 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
241 | for details.</para></listitem> | |
242 | </varlistentry> | |
243 | ||
3519d230 KZ |
244 | <varlistentry> |
245 | <term><option>x-systemd.requires-mounts-for=</option></term> | |
246 | ||
247 | <listitem><para>Configures a | |
248 | <varname>RequiresMountsFor=</varname> dependency between the | |
249 | created mount unit and other mount units. The argument must be | |
250 | an absolute path. This option may be specified more than once. | |
251 | See <varname>RequiresMountsFor=</varname> in | |
252 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
253 | for details.</para></listitem> | |
254 | </varlistentry> | |
255 | ||
ebc8968b FB |
256 | <varlistentry> |
257 | <term><option>x-systemd.device-bound</option></term> | |
258 | ||
259 | <listitem><para>The block device backed file system will be upgraded | |
260 | to <varname>BindsTo=</varname> dependency. This option is only useful | |
261 | when mounting file systems manually with | |
98e9d710 | 262 | <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
ebc8968b FB |
263 | as the default dependency in this case is <varname>Requires=</varname>. |
264 | This option is already implied by entries in <filename>/etc/fstab</filename> | |
265 | or by mount units. | |
266 | </para></listitem> | |
267 | </varlistentry> | |
268 | ||
798d3a52 ZJS |
269 | <varlistentry> |
270 | <term><option>x-systemd.automount</option></term> | |
271 | ||
272 | <listitem><para>An automount unit will be created for the file | |
273 | system. See | |
274 | <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
275 | for details.</para></listitem> | |
276 | </varlistentry> | |
277 | ||
deb0a77c MO |
278 | <varlistentry> |
279 | <term><option>x-systemd.idle-timeout=</option></term> | |
280 | ||
a8eaaee7 | 281 | <listitem><para>Configures the idle timeout of the |
deb0a77c MO |
282 | automount unit. See <varname>TimeoutIdleSec=</varname> in |
283 | <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
284 | for details.</para></listitem> | |
285 | </varlistentry> | |
286 | ||
f0c5cda2 | 287 | <varlistentry id='device-timeout'> |
798d3a52 ZJS |
288 | <term><option>x-systemd.device-timeout=</option></term> |
289 | ||
290 | <listitem><para>Configure how long systemd should wait for a | |
291 | device to show up before giving up on an entry from | |
292 | <filename>/etc/fstab</filename>. Specify a time in seconds or | |
a8eaaee7 | 293 | explicitly append a unit such as <literal>s</literal>, |
798d3a52 ZJS |
294 | <literal>min</literal>, <literal>h</literal>, |
295 | <literal>ms</literal>.</para> | |
296 | ||
297 | <para>Note that this option can only be used in | |
298 | <filename>/etc/fstab</filename>, and will be | |
a8eaaee7 | 299 | ignored when part of the <varname>Options=</varname> |
798d3a52 ZJS |
300 | setting in a unit file.</para> |
301 | </listitem> | |
302 | </varlistentry> | |
303 | ||
110773f6 CH |
304 | <varlistentry> |
305 | <term><option>x-systemd.mount-timeout=</option></term> | |
306 | ||
307 | <listitem><para>Configure how long systemd should wait for the | |
308 | mount command to finish before giving up on an entry from | |
309 | <filename>/etc/fstab</filename>. Specify a time in seconds or | |
310 | explicitly append a unit such as <literal>s</literal>, | |
311 | <literal>min</literal>, <literal>h</literal>, | |
312 | <literal>ms</literal>.</para> | |
313 | ||
314 | <para>Note that this option can only be used in | |
315 | <filename>/etc/fstab</filename>, and will be | |
316 | ignored when part of the <varname>Options=</varname> | |
317 | setting in a unit file.</para> | |
318 | ||
319 | <para>See <varname>TimeoutSec=</varname> below for | |
320 | details.</para> | |
321 | </listitem> | |
322 | </varlistentry> | |
0f00528d | 323 | |
58e0ac33 ZJS |
324 | <varlistentry> |
325 | <term><option>x-systemd.makefs</option></term> | |
326 | ||
f0c5cda2 | 327 | <listitem><para>The file system will be initialized |
58e0ac33 ZJS |
328 | on the device. If the device is not "empty", i.e. it contains any signature, |
329 | the operation will be skipped. It is hence expected that this option | |
5238e957 | 330 | remains set even after the device has been initialized.</para> |
58e0ac33 ZJS |
331 | |
332 | <para>Note that this option can only be used in | |
333 | <filename>/etc/fstab</filename>, and will be ignored when part of the | |
334 | <varname>Options=</varname> setting in a unit file.</para> | |
335 | ||
336 | <para>See | |
337 | <citerefentry><refentrytitle>systemd-makefs@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>. | |
338 | </para> | |
339 | ||
340 | <para><citerefentry project='man-pages'><refentrytitle>wipefs</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
341 | may be used to remove any signatures from a block device to force | |
342 | <option>x-systemd.makefs</option> to reinitialize the device.</para> | |
343 | </listitem> | |
344 | </varlistentry> | |
345 | ||
346 | <varlistentry> | |
347 | <term><option>x-systemd.growfs</option></term> | |
348 | ||
349 | <listitem><para>The file system will be grown to occupy the full block | |
350 | device. If the file system is already at maximum size, no action will | |
351 | be performed. It is hence expected that this option remains set even after | |
352 | the file system has been grown. Only certain file system types are supported, | |
353 | see | |
354 | <citerefentry><refentrytitle>systemd-makefs@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
355 | for details.</para> | |
356 | ||
357 | <para>Note that this option can only be used in | |
358 | <filename>/etc/fstab</filename>, and will be ignored when part of the | |
359 | <varname>Options=</varname> setting in a unit file.</para></listitem> | |
360 | </varlistentry> | |
361 | ||
0f00528d ZJS |
362 | <varlistentry> |
363 | <term><option>_netdev</option></term> | |
364 | ||
365 | <listitem><para>Normally the file system type is used to determine if a | |
366 | mount is a "network mount", i.e. if it should only be started after the | |
367 | network is available. Using this option overrides this detection and | |
368 | specifies that the mount requires network.</para> | |
369 | ||
370 | <para>Network mount units are ordered between <filename>remote-fs-pre.target</filename> | |
371 | and <filename>remote-fs.target</filename>, instead of | |
372 | <filename>local-fs-pre.target</filename> and <filename>local-fs.target</filename>. | |
373 | They also pull in <filename>network-online.target</filename> and are ordered after | |
374 | it and <filename>network.target</filename>.</para> | |
375 | </listitem> | |
376 | </varlistentry> | |
377 | ||
798d3a52 ZJS |
378 | <varlistentry> |
379 | <term><option>noauto</option></term> | |
380 | <term><option>auto</option></term> | |
381 | ||
0c08bc7f LP |
382 | <listitem><para>With <option>noauto</option>, the mount unit will not be added as a dependency for |
383 | <filename>local-fs.target</filename> or <filename>remote-fs.target</filename>. This means that it will not be | |
384 | mounted automatically during boot, unless it is pulled in by some other unit. The <option>auto</option> option | |
385 | has the opposite meaning and is the default. Note that the <option>noauto</option> option has an effect on the | |
386 | mount unit itself only — if <option>x-systemd.automount</option> is used (see above), then the matching | |
387 | automount unit will still be pulled in by these targets.</para> | |
798d3a52 ZJS |
388 | </listitem> |
389 | </varlistentry> | |
390 | ||
391 | <varlistentry> | |
392 | <term><option>nofail</option></term> | |
393 | ||
e6c7c7ff LP |
394 | <listitem><para>With <option>nofail</option>, this mount will be only wanted, not required, by |
395 | <filename>local-fs.target</filename> or <filename>remote-fs.target</filename>. Moreover the mount unit is not | |
396 | ordered before these target units. This means that the boot will continue without waiting for the mount unit | |
397 | and regardless whether the mount point can be mounted successfully.</para> | |
798d3a52 ZJS |
398 | </listitem> |
399 | </varlistentry> | |
400 | ||
401 | <varlistentry> | |
402 | <term><option>x-initrd.mount</option></term> | |
403 | ||
404 | <listitem><para>An additional filesystem to be mounted in the | |
405 | initramfs. See <filename>initrd-fs.target</filename> | |
406 | description in | |
407 | <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>. | |
408 | </para></listitem> | |
409 | </varlistentry> | |
410 | </variablelist> | |
411 | ||
412 | <para>If a mount point is configured in both | |
413 | <filename>/etc/fstab</filename> and a unit file that is stored | |
414 | below <filename>/usr</filename>, the former will take precedence. | |
415 | If the unit file is stored below <filename>/etc</filename>, it | |
416 | will take precedence. This means: native unit files take | |
417 | precedence over traditional configuration files, but this is | |
418 | superseded by the rule that configuration in | |
419 | <filename>/etc</filename> will always take precedence over | |
420 | configuration in <filename>/usr</filename>.</para> | |
421 | </refsect1> | |
422 | ||
423 | <refsect1> | |
424 | <title>Options</title> | |
425 | ||
426 | <para>Mount files must include a [Mount] section, which carries | |
427 | information about the file system mount points it supervises. A | |
428 | number of options that may be used in this section are shared with | |
429 | other unit types. These options are documented in | |
430 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
431 | and | |
432 | <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
433 | The options specific to the [Mount] section of mount units are the | |
434 | following:</para> | |
435 | ||
436 | <variablelist class='unit-directives'> | |
437 | ||
438 | <varlistentry> | |
439 | <term><varname>What=</varname></term> | |
151a7133 LP |
440 | <listitem><para>Takes an absolute path of a device node, file or other resource to mount. See |
441 | <citerefentry | |
442 | project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> for | |
443 | details. If this refers to a device node, a dependency on the respective device unit is automatically | |
444 | created. (See | |
445 | <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
446 | for more information.) This option is mandatory. Note that the usual specifier expansion is applied | |
6dbf4025 ZJS |
447 | to this setting, literal percent characters should hence be written as <literal |
448 | class='specifiers'>%%</literal>. If this mount is a bind mount and the specified path does not exist | |
449 | yet it is created as directory.</para></listitem> | |
798d3a52 ZJS |
450 | </varlistentry> |
451 | ||
452 | <varlistentry> | |
453 | <term><varname>Where=</varname></term> | |
f9951b0c LP |
454 | <listitem><para>Takes an absolute path of a file or directory for the mount point; in particular, the |
455 | destination cannot be a symbolic link. If the mount point does not exist at the time of mounting, it | |
456 | is created as directory. This string must be reflected in the unit filename. (See above.) This option | |
457 | is mandatory.</para></listitem> | |
798d3a52 ZJS |
458 | </varlistentry> |
459 | ||
460 | <varlistentry> | |
461 | <term><varname>Type=</varname></term> | |
462 | <listitem><para>Takes a string for the file system type. See | |
3ba3a79d | 463 | <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
798d3a52 ZJS |
464 | for details. This setting is optional.</para></listitem> |
465 | </varlistentry> | |
466 | ||
467 | <varlistentry> | |
468 | <term><varname>Options=</varname></term> | |
469 | ||
d5cc4be2 LP |
470 | <listitem><para>Mount options to use when mounting. This takes a comma-separated list of options. This setting |
471 | is optional. Note that the usual specifier expansion is applied to this setting, literal percent characters | |
6dbf4025 | 472 | should hence be written as <literal class='specifiers'>%%</literal>.</para></listitem> |
798d3a52 ZJS |
473 | </varlistentry> |
474 | ||
475 | <varlistentry> | |
476 | <term><varname>SloppyOptions=</varname></term> | |
477 | ||
478 | <listitem><para>Takes a boolean argument. If true, parsing of | |
479 | the options specified in <varname>Options=</varname> is | |
480 | relaxed, and unknown mount options are tolerated. This | |
481 | corresponds with | |
3ba3a79d | 482 | <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s |
798d3a52 ZJS |
483 | <parameter>-s</parameter> switch. Defaults to |
484 | off.</para></listitem> | |
485 | </varlistentry> | |
e520950a BR |
486 | |
487 | <varlistentry> | |
488 | <term><varname>LazyUnmount=</varname></term> | |
489 | ||
490 | <listitem><para>Takes a boolean argument. If true, detach the | |
491 | filesystem from the filesystem hierarchy at time of the unmount | |
492 | operation, and clean up all references to the filesystem as | |
493 | soon as they are not busy anymore. | |
494 | This corresponds with | |
495 | <citerefentry project='man-pages'><refentrytitle>umount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s | |
496 | <parameter>-l</parameter> switch. Defaults to | |
497 | off.</para></listitem> | |
498 | </varlistentry> | |
4f8d40a9 BR |
499 | |
500 | <varlistentry> | |
501 | <term><varname>ForceUnmount=</varname></term> | |
502 | ||
503 | <listitem><para>Takes a boolean argument. If true, force an | |
504 | unmount (in case of an unreachable NFS system). | |
505 | This corresponds with | |
506 | <citerefentry project='man-pages'><refentrytitle>umount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s | |
507 | <parameter>-f</parameter> switch. Defaults to | |
508 | off.</para></listitem> | |
509 | </varlistentry> | |
798d3a52 ZJS |
510 | |
511 | <varlistentry> | |
512 | <term><varname>DirectoryMode=</varname></term> | |
513 | <listitem><para>Directories of mount points (and any parent | |
514 | directories) are automatically created if needed. This option | |
515 | specifies the file system access mode used when creating these | |
516 | directories. Takes an access mode in octal notation. Defaults | |
517 | to 0755.</para></listitem> | |
518 | </varlistentry> | |
519 | ||
520 | <varlistentry> | |
521 | <term><varname>TimeoutSec=</varname></term> | |
522 | <listitem><para>Configures the time to wait for the mount | |
523 | command to finish. If a command does not exit within the | |
524 | configured time, the mount will be considered failed and be | |
525 | shut down again. All commands still running will be terminated | |
526 | forcibly via <constant>SIGTERM</constant>, and after another | |
527 | delay of this time with <constant>SIGKILL</constant>. (See | |
528 | <option>KillMode=</option> in | |
529 | <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.) | |
530 | Takes a unit-less value in seconds, or a time span value such | |
531 | as "5min 20s". Pass 0 to disable the timeout logic. The | |
7e68a33b YW |
532 | default value is set from <varname>DefaultTimeoutStartSec=</varname> option in |
533 | <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
534 | </para></listitem> | |
798d3a52 ZJS |
535 | </varlistentry> |
536 | </variablelist> | |
537 | ||
538 | <para>Check | |
539 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
540 | and | |
541 | <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
542 | for more settings.</para> | |
543 | </refsect1> | |
544 | ||
545 | <refsect1> | |
546 | <title>See Also</title> | |
547 | <para> | |
548 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
549 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
7e68a33b | 550 | <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
798d3a52 ZJS |
551 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
552 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
553 | <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
554 | <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
555 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
556 | <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
557 | <citerefentry project='man-pages'><refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
3ba3a79d | 558 | <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
798d3a52 | 559 | <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
438e6a48 LP |
560 | <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
561 | <citerefentry><refentrytitle>systemd-mount</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
798d3a52 ZJS |
562 | </para> |
563 | </refsect1> | |
cdb788e4 LP |
564 | |
565 | </refentry> |