chiark / gitweb /
man: refer to snapshot man page from unit man page
[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 General Public License as published by
13   the Free Software Foundation; either version 2 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   General Public License for more details.
20
21   You should have received a copy of the GNU 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>systemd mount configuration files</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename>systemd.mount</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>A unit configuration file whose name ends in
58                 <filename>.mount</filename> 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>.</para>
73
74                 <para>Mount units must be named after the mount point
75                 directories they control. Example: the mount point
76                 <filename>/home/lennart</filename> must be configured
77                 in a unit file
78                 <filename>home-lennart.mount</filename>. For details
79                 about the escaping logic used to convert a file system
80                 path to a unit name see
81                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
82
83                 <para>Optionally, a mount unit may be accompanied by
84                 an automount unit, to allow on-demand or parallelized
85                 mounting. See
86                 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
87
88                 <para>If an mount point is beneath another mount point
89                 in the file system hierarchy, a dependency between both
90                 units is created automatically.</para>
91
92                 <para>Mount points created at runtime independent on
93                 unit files or <filename>/etc/fstab</filename> will be
94                 monitored by systemd and appear like any other mount
95                 unit in systemd.</para>
96         </refsect1>
97
98         <refsect1>
99                 <title><filename>fstab</filename></title>
100
101                 <para>Mount units may either be configured via unit
102                 files, or via <filename>/etc/fstab</filename> (see
103                 <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
104                 for details).</para>
105
106                 <para>When reading <filename>/etc/fstab</filename> a
107                 few special mount options are understood by systemd
108                 which influence how dependencies are created for mount
109                 points from <filename>/etc/fstab</filename>. If
110                 <option>comment=systemd.mount</option> is specified as
111                 mount option, then systemd will create a dependency of
112                 type <option>Wants</option> from either
113                 <filename>local-fs.target</filename> or
114                 <filename>remote-fs.target</filename>, depending
115                 whether the file system is local or remote. If
116                 <option>comment=systemd.automount</option> is set, an
117                 automount unit will be created for the file system. See
118                 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
119                 for details.</para>
120
121                 <para>If a mount point is configured in both
122                 <filename>/etc/fstab</filename> and a unit file, the
123                 configuration in the latter takes precedence.</para>
124         </refsect1>
125
126         <refsect1>
127                 <title>Options</title>
128
129                 <para>Mount files must include a [Mount] section,
130                 which carries information about the file system mount points it
131                 supervises. A number of options that may be used in
132                 this section are shared with other unit types. These
133                 options are documented in
134                 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
135                 options specific to the [Mount] section of mount
136                 units are the following:</para>
137
138                 <variablelist>
139
140                         <varlistentry>
141                                 <term><varname>What=</varname></term>
142                                 <listitem><para>Takes an absolute path
143                                 of a device node, file or other
144                                 resource to mount. See
145                                 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
146                                 for details. If this refers to a
147                                 device node, a dependency on the
148                                 respective device unit is
149                                 automatically created. (See
150                                 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.)
151                                 This option is
152                                 mandatory.</para></listitem>
153                         </varlistentry>
154
155                         <varlistentry>
156                                 <term><varname>Where=</varname></term>
157                                 <listitem><para>Takes an absolute path
158                                 of a directory of the mount point. If
159                                 the mount point is not existing at
160                                 time of mounting, it is created. This
161                                 string must be reflected in the unit
162                                 file name. (See above.) This option is
163                                 mandatory.</para></listitem>
164                         </varlistentry>
165
166                         <varlistentry>
167                                 <term><varname>Type=</varname></term>
168                                 <listitem><para>Takes a string for the
169                                 filesystem type. See
170                                 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
171                                 for details. This setting is
172                                 optional.</para></listitem>
173                         </varlistentry>
174
175                         <varlistentry>
176                                 <term><varname>Options=</varname></term>
177
178                                 <listitem><para>Mount options to use
179                                 when mounting. This takes a comma
180                                 seperated list of options. This
181                                 setting is optional.</para></listitem>
182                         </varlistentry>
183
184                         <varlistentry>
185                                 <term><varname>DirectoryMode=</varname></term>
186                                 <listitem><para>Directories of mount
187                                 points (and any parent directories)
188                                 are automatically created if
189                                 needed. This option specifies the file
190                                 system access mode used when creating
191                                 these directories. Defaults to
192                                 0755.</para></listitem>
193                         </varlistentry>
194
195                         <varlistentry>
196                                 <term><varname>TimeoutSec=</varname></term>
197                                 <listitem><para>Configures the time to
198                                 wait for the mount command to
199                                 finish. If a command does not exit
200                                 within the configured time the mount
201                                 will be considered failed and be shut
202                                 down again. All commands still running
203                                 will be terminated forcibly via
204                                 SIGTERM, and after another delay of
205                                 this time with SIGKILL. (See
206                                 <option>KillMode=</option> below.)
207                                 Takes a unit-less value in seconds, or
208                                 a time span value such as "5min
209                                 20s". Pass 0 to disable the timeout
210                                 logic. Defaults to
211                                 60s.</para></listitem>
212                         </varlistentry>
213
214                         <varlistentry>
215                                 <term><varname>KillMode=</varname></term>
216                                 <listitem><para>Specifies how
217                                 processes of this mount shall be
218                                 killed. One of
219                                 <option>control-group</option>,
220                                 <option>process-group</option>,
221                                 <option>process</option>,
222                                 <option>none</option>.</para>
223
224                                 <para>This option is mostly equivalent
225                                 to the <option>KillMode=</option>
226                                 option of service files. See
227                                 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
228                                 for details.</para></listitem>
229                         </varlistentry>
230                 </variablelist>
231         </refsect1>
232
233         <refsect1>
234                   <title>See Also</title>
235                   <para>
236                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
237                           <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
238                           <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
239                           <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
240                           <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
241                           <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
242                   </para>
243         </refsect1>
244
245 </refentry>