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