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">
7 This file is part of systemd.
9 Copyright 2010 Lennart Poettering
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.
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.
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/>.
25 <refentry id="systemd.mount">
27 <title>systemd.mount</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>systemd.mount</refentrytitle>
42 <manvolnum>5</manvolnum>
46 <refname>systemd.mount</refname>
47 <refpurpose>Mount unit configuration</refpurpose>
51 <para><filename>systemd.mount</filename></para>
55 <title>Description</title>
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
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>
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
78 terminated. The User= and Group= options are not useful
79 for mount units specifying a Type= option; the mount
80 binary must run as root if there is a specified type.</para>
82 <para>Mount units must be named after the mount point
83 directories they control. Example: the mount point
84 <filename>/home/lennart</filename> must be configured
86 <filename>home-lennart.mount</filename>. For details
87 about the escaping logic used to convert a file system
88 path to a unit name see
89 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
91 <para>Optionally, a mount unit may be accompanied by
92 an automount unit, to allow on-demand or parallelized
94 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
96 <para>If a mount point is beneath another mount point
97 in the file system hierarchy, a dependency between both
98 units is created automatically.</para>
100 <para>Mount points created at runtime independent on
101 unit files or <filename>/etc/fstab</filename> will be
102 monitored by systemd and appear like any other mount
103 unit in systemd.</para>
107 <title><filename>/etc/fstab</filename></title>
109 <para>Mount units may either be configured via unit
110 files, or via <filename>/etc/fstab</filename> (see
111 <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
112 for details). Mounts listed in
113 <filename>/etc/fstab</filename> will be converted into
114 native units dynamically at boot and when the
115 configuration of the system manager is reloaded. See
116 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
117 for details about the conversion.</para>
119 <para>When reading <filename>/etc/fstab</filename> a
120 few special mount options are understood by systemd
121 which influence how dependencies are created for mount
122 points from <filename>/etc/fstab</filename>. systemd
123 will create a dependency of type
124 <option>Wants</option> from either
125 <filename>local-fs.target</filename> or
126 <filename>remote-fs.target</filename>, depending
127 whether the file system is local or remote. If
128 <option>x-systemd.automount</option> is set, an
129 automount unit will be created for the file
131 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
133 <option>x-systemd.device-timeout=</option> is
134 specified it may be used to configure how long systemd
135 should wait for a device to show up before giving up
137 <filename>/etc/fstab</filename>. Specify a time in
138 seconds or explicitly specify a unit as
139 <literal>s</literal>, <literal>min</literal>,
140 <literal>h</literal>, <literal>ms</literal>.</para>
142 <para>If a mount point is configured in both
143 <filename>/etc/fstab</filename> and a unit file, the
144 configuration in the latter takes precedence.</para>
148 <title>Options</title>
150 <para>Mount files must include a [Mount] section,
151 which carries information about the file system mount points it
152 supervises. A number of options that may be used in
153 this section are shared with other unit types. These
154 options are documented in
155 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
157 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
158 options specific to the [Mount] section of mount
159 units are the following:</para>
164 <term><varname>What=</varname></term>
165 <listitem><para>Takes an absolute path
166 of a device node, file or other
167 resource to mount. See
168 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
169 for details. If this refers to a
170 device node, a dependency on the
171 respective device unit is
172 automatically created. (See
173 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.)
175 mandatory.</para></listitem>
179 <term><varname>Where=</varname></term>
180 <listitem><para>Takes an absolute path
181 of a directory of the mount point. If
182 the mount point does not exist at the
183 time of mounting, it is created. This
184 string must be reflected in the unit
185 file name. (See above.) This option is
186 mandatory.</para></listitem>
190 <term><varname>Type=</varname></term>
191 <listitem><para>Takes a string for the
193 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
194 for details. This setting is
195 optional.</para></listitem>
199 <term><varname>Options=</varname></term>
201 <listitem><para>Mount options to use
202 when mounting. This takes a comma
203 separated list of options. This
204 setting is optional.</para></listitem>
208 <term><varname>DirectoryMode=</varname></term>
209 <listitem><para>Directories of mount
210 points (and any parent directories)
211 are automatically created if
212 needed. This option specifies the file
213 system access mode used when creating
214 these directories. Takes an access
215 mode in octal notation. Defaults to
216 0755.</para></listitem>
220 <term><varname>TimeoutSec=</varname></term>
221 <listitem><para>Configures the time to
222 wait for the mount command to
223 finish. If a command does not exit
224 within the configured time the mount
225 will be considered failed and be shut
226 down again. All commands still running
227 will be terminated forcibly via
228 SIGTERM, and after another delay of
229 this time with SIGKILL. (See
230 <option>KillMode=</option> in
231 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>.)
232 Takes a unit-less value in seconds, or
233 a time span value such as "5min
234 20s". Pass 0 to disable the timeout
236 90s.</para></listitem>
241 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
243 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>
244 for more settings.</para>
248 <title>Compatibility Options</title>
250 <para>The following option is also available in the
251 <literal>[Mount]</literal> section, but exists purely
252 for compatibility reasons and should not be used in
253 newly written mount files.</para>
257 <term><varname>FsckPassNo=</varname></term>
259 <listitem><para>The pass number for
260 the file system checking service for
262 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
263 for more information on this setting.
270 <title>See Also</title>
272 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
273 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
274 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
275 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
276 <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
277 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
278 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
279 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
280 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>