chiark / gitweb /
man: fix typo
[elogind.git] / man / systemd.mount.xml
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
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
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
19   Lesser General Public License for more details.
20
21   You should have received a copy of the GNU Lesser General Public License
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>
47                 <refpurpose>Mount unit configuration</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename><replaceable>mount</replaceable>.mount</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>A unit configuration file whose name ends in
58                 <literal>.mount</literal> encodes information about
59                 a file system mount point controlled and supervised by
60                 systemd.</para>
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
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>
75                 binary is executed in, and in
76                 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
77                 which define the way the processes are terminated, and
78                 in
79                 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
80                 which configure resource control settings for the
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>;
86                 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
87                 will refuse options that are not listed in
88                 <filename>/etc/fstab</filename> if it is not run as
89                 UID 0.</para>
90
91                 <para>Mount units must be named after the mount point
92                 directories they control. Example: the mount point
93                 <filename noindex='true'>/home/lennart</filename> must be configured
94                 in a unit file
95                 <filename>home-lennart.mount</filename>. For details
96                 about the escaping logic used to convert a file system
97                 path to a unit name, see
98                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
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>
104
105                 <para>If a mount point is beneath another mount point
106                 in the file system hierarchy, a dependency between both
107                 units is created automatically.</para>
108
109                 <para>Mount points created at runtime (independently of
110                 unit files or <filename>/etc/fstab</filename>) will be
111                 monitored by systemd and appear like any other mount
112                 unit in systemd.
113                 See <filename>/proc/self/mountinfo</filename> description
114                 in <citerefentry project='man-pages'><refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
115                 </para>
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>
124         </refsect1>
125
126         <refsect1>
127                 <title><filename>/etc/fstab</filename></title>
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>
132                 for details). Mounts listed in
133                 <filename>/etc/fstab</filename> will be converted into
134                 native units dynamically at boot and when the
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
139                 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
140                 for details about the conversion.</para>
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
145                 points from <filename>/etc/fstab</filename>. systemd
146                 will create a dependency of type
147                 <option>Wants</option> or <option>Requires</option>
148                 (see option <option>nofail</option> below), from
149                 either <filename>local-fs.target</filename> or
150                 <filename>remote-fs.target</filename>, depending
151                 whether the file system is local or remote.</para>
152
153                 <variablelist class='fstab-options'>
154
155                   <varlistentry>
156                     <term><option>x-systemd.automount</option></term>
157
158                     <listitem><para>An automount unit will be created
159                     for the file system. See
160                     <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
161                     for details.</para></listitem>
162                   </varlistentry>
163
164                   <varlistentry>
165                     <term><option>x-systemd.device-timeout=</option></term>
166
167                     <listitem><para>Configure how long systemd should
168                     wait for a device to show up before giving up on
169                     an entry from
170                     <filename>/etc/fstab</filename>. Specify a time in
171                     seconds or explicitly append a unit as
172                     <literal>s</literal>, <literal>min</literal>,
173                     <literal>h</literal>,
174                     <literal>ms</literal>.</para>
175
176                     <para>Note that this option can only be used in
177                     <filename>/etc/fstab</filename>, and will be
178                     ignored when part of <varname>Options=</varname>
179                     setting in a unit file.</para>
180                     </listitem>
181                   </varlistentry>
182
183                   <varlistentry>
184                     <term><option>nofail</option></term>
185                     <term><option>fail</option></term>
186
187                     <listitem><para>With <option>nofail</option> this
188                     mount will be only wanted, not required, by the
189                     <filename>local-fs.target</filename>. This means
190                     that the boot will continue even if this mount
191                     point is not mounted successfully. Option
192                     <option>fail</option> has the opposite meaning and
193                     is the default.</para>
194                     </listitem>
195                   </varlistentry>
196
197                   <varlistentry>
198                     <term><option>noauto</option></term>
199                     <term><option>auto</option></term>
200
201                     <listitem><para>With <option>noauto</option>, this
202                     mount will not be added as a dependency for
203                     <filename>local-fs.target</filename>. This means
204                     that it will not be mounted automatically during
205                     boot, unless it is pulled in by some other
206                     unit. Option <option>auto</option> has the
207                     opposite meaning and is the default.</para>
208                     </listitem>
209                   </varlistentry>
210
211                   <varlistentry>
212                     <term><option>x-initrd.mount</option></term>
213
214                     <listitem><para>An additional filesystem to be
215                     mounted in the initramfs. See
216                     <filename>initrd-fs.target</filename> description
217                     in
218                     <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
219                     </para></listitem>
220                   </varlistentry>
221                 </variablelist>
222
223                 <para>If a mount point is configured in both
224                 <filename>/etc/fstab</filename> and a unit file that
225                 is stored below <filename>/usr</filename>, the former
226                 will take precedence. If the unit file is stored below
227                 <filename>/etc</filename>, it will take
228                 precedence. This means: native unit files take
229                 precedence over traditional configuration files, but
230                 this is superseded by the rule that configuration in
231                 <filename>/etc</filename> will always take precedence
232                 over configuration in
233                 <filename>/usr</filename>.</para>
234         </refsect1>
235
236         <refsect1>
237                 <title>Options</title>
238
239                 <para>Mount files must include a [Mount] section,
240                 which carries information about the file system mount points it
241                 supervises. A number of options that may be used in
242                 this section are shared with other unit types. These
243                 options are documented in
244                 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
245                 and
246                 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
247                 options specific to the [Mount] section of mount
248                 units are the following:</para>
249
250                 <variablelist class='unit-directives'>
251
252                         <varlistentry>
253                                 <term><varname>What=</varname></term>
254                                 <listitem><para>Takes an absolute path
255                                 of a device node, file or other
256                                 resource to mount. See
257                                 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
258                                 for details. If this refers to a
259                                 device node, a dependency on the
260                                 respective device unit is
261                                 automatically created. (See
262                                 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.)
263                                 This option is
264                                 mandatory.</para></listitem>
265                         </varlistentry>
266
267                         <varlistentry>
268                                 <term><varname>Where=</varname></term>
269                                 <listitem><para>Takes an absolute path
270                                 of a directory of the mount point. If
271                                 the mount point does not exist at the
272                                 time of mounting, it is created. This
273                                 string must be reflected in the unit
274                                 filename. (See above.) This option is
275                                 mandatory.</para></listitem>
276                         </varlistentry>
277
278                         <varlistentry>
279                                 <term><varname>Type=</varname></term>
280                                 <listitem><para>Takes a string for the
281                                 file system type. See
282                                 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
283                                 for details. This setting is
284                                 optional.</para></listitem>
285                         </varlistentry>
286
287                         <varlistentry>
288                                 <term><varname>Options=</varname></term>
289
290                                 <listitem><para>Mount options to use
291                                 when mounting. This takes a
292                                 comma-separated list of options. This
293                                 setting is optional.</para></listitem>
294                         </varlistentry>
295
296                         <varlistentry>
297                                 <term><varname>SloppyOptions=</varname></term>
298
299                                 <listitem><para>Takes a boolean
300                                 argument. If true, parsing of the
301                                 options specified in
302                                 <varname>Options=</varname> is
303                                 relaxed, and unknown mount options are
304                                 tolerated. This corresponds with
305                                 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
306                                 <parameter>-s</parameter>
307                                 switch. Defaults to
308                                 off.</para></listitem>
309                         </varlistentry>
310
311                         <varlistentry>
312                                 <term><varname>DirectoryMode=</varname></term>
313                                 <listitem><para>Directories of mount
314                                 points (and any parent directories)
315                                 are automatically created if
316                                 needed. This option specifies the file
317                                 system access mode used when creating
318                                 these directories. Takes an access
319                                 mode in octal notation. Defaults to
320                                 0755.</para></listitem>
321                         </varlistentry>
322
323                         <varlistentry>
324                                 <term><varname>TimeoutSec=</varname></term>
325                                 <listitem><para>Configures the time to
326                                 wait for the mount command to
327                                 finish. If a command does not exit
328                                 within the configured time, the mount
329                                 will be considered failed and be shut
330                                 down again. All commands still running
331                                 will be terminated forcibly via
332                                 <constant>SIGTERM</constant>, and after another delay of
333                                 this time with <constant>SIGKILL</constant>. (See
334                                 <option>KillMode=</option> in
335                                 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.)
336                                 Takes a unit-less value in seconds, or
337                                 a time span value such as "5min
338                                 20s". Pass 0 to disable the timeout
339                                 logic. The default value is set from the manager configuration
340                                 file's <varname>DefaultTimeoutStart=</varname> variable.</para></listitem>
341                         </varlistentry>
342                 </variablelist>
343
344                 <para>Check
345                 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
346                 and
347                 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>
348                 for more settings.</para>
349         </refsect1>
350
351         <refsect1>
352                   <title>See Also</title>
353                   <para>
354                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
355                           <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
356                           <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
357                           <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
358                           <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
359                           <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
360                           <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
361                           <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
362                           <citerefentry project='man-pages'><refentrytitle>proc</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
363                           <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
364                           <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
365                           <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>
366                   </para>
367         </refsect1>
368
369 </refentry>