]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.mount.xml
man: add reference to export format spec to journalctl
[thirdparty/systemd.git] / man / systemd.mount.xml
CommitLineData
cdb788e4
LP
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
5430f7f2
LP
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
cdb788e4
LP
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
5430f7f2 19 Lesser General Public License for more details.
cdb788e4 20
5430f7f2 21 You should have received a copy of the GNU Lesser General Public License
cdb788e4
LP
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>
34511ca7 47 <refpurpose>Mount unit configuration</refpurpose>
cdb788e4
LP
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
65232ea7
LP
58 <filename>.mount</filename> encodes information about
59 a file system mount point controlled and supervised by
60 systemd.</para>
cdb788e4
LP
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
ba60f905
LP
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.</para>
cdb788e4 76
e0cabd4b
LP
77 <para>Mount units must be named after the mount point
78 directories they control. Example: the mount point
cdb788e4
LP
79 <filename>/home/lennart</filename> must be configured
80 in a unit file
81 <filename>home-lennart.mount</filename>. For details
82 about the escaping logic used to convert a file system
83 path to a unit name see
84 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
65232ea7
LP
85
86 <para>Optionally, a mount unit may be accompanied by
87 an automount unit, to allow on-demand or parallelized
88 mounting. See
89 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
e0cabd4b
LP
90
91 <para>If an mount point is beneath another mount point
b439c6ee 92 in the file system hierarchy, a dependency between both
e0cabd4b 93 units is created automatically.</para>
b36b082c
LP
94
95 <para>Mount points created at runtime independent on
96 unit files or <filename>/etc/fstab</filename> will be
97 monitored by systemd and appear like any other mount
98 unit in systemd.</para>
cdb788e4
LP
99 </refsect1>
100
101 <refsect1>
fa4ab997 102 <title><filename>/etc/fstab</filename></title>
cdb788e4
LP
103
104 <para>Mount units may either be configured via unit
105 files, or via <filename>/etc/fstab</filename> (see
106 <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
059b37cc
LP
107 for details). Mounts listed in
108 <filename>/etc/fstab</filename> will be converted into
109 native units dynamically at boot and when the
110 configuration of the system manager is reloaded. See
111 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
112 for details about the conversion.</para>
cdb788e4
LP
113
114 <para>When reading <filename>/etc/fstab</filename> a
115 few special mount options are understood by systemd
116 which influence how dependencies are created for mount
92a39ae1
LP
117 points from <filename>/etc/fstab</filename>. systemd
118 will create a dependency of type
119 <option>Wants</option> from either
cdb788e4
LP
120 <filename>local-fs.target</filename> or
121 <filename>remote-fs.target</filename>, depending
122 whether the file system is local or remote. If
fa4ab997
LP
123 <option>x-systemd.automount</option> is set, an
124 automount unit will be created for the file
125 system. See
cdb788e4 126 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
fa4ab997 127 for details. If
92a39ae1 128 <option>x-systemd.device-timeout=</option> is
fa4ab997
LP
129 specified it may be used to configure how long systemd
130 should wait for a device to show up before giving up
131 on an entry from
132 <filename>/etc/fstab</filename>. Specify a time in
133 seconds or explicitly specifiy a unit as
134 <literal>s</literal>, <literal>min</literal>,
135 <literal>h</literal>, <literal>ms</literal>.</para>
cdb788e4
LP
136
137 <para>If a mount point is configured in both
b439c6ee 138 <filename>/etc/fstab</filename> and a unit file, the
cdb788e4
LP
139 configuration in the latter takes precedence.</para>
140 </refsect1>
141
142 <refsect1>
143 <title>Options</title>
144
145 <para>Mount files must include a [Mount] section,
146 which carries information about the file system mount points it
147 supervises. A number of options that may be used in
148 this section are shared with other unit types. These
149 options are documented in
150 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
65232ea7 151 options specific to the [Mount] section of mount
cdb788e4
LP
152 units are the following:</para>
153
154 <variablelist>
155
156 <varlistentry>
157 <term><varname>What=</varname></term>
158 <listitem><para>Takes an absolute path
159 of a device node, file or other
160 resource to mount. See
161 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
162 for details. If this refers to a
b439c6ee 163 device node, a dependency on the
cdb788e4
LP
164 respective device unit is
165 automatically created. (See
166 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.)
167 This option is
168 mandatory.</para></listitem>
169 </varlistentry>
170
171 <varlistentry>
172 <term><varname>Where=</varname></term>
173 <listitem><para>Takes an absolute path
174 of a directory of the mount point. If
175 the mount point is not existing at
b439c6ee 176 time of mounting, it is created. This
cdb788e4
LP
177 string must be reflected in the unit
178 file name. (See above.) This option is
179 mandatory.</para></listitem>
180 </varlistentry>
181
182 <varlistentry>
183 <term><varname>Type=</varname></term>
184 <listitem><para>Takes a string for the
185 filesystem type. See
186 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>
187 for details. This setting is
188 optional.</para></listitem>
189 </varlistentry>
190
191 <varlistentry>
192 <term><varname>Options=</varname></term>
193
194 <listitem><para>Mount options to use
195 when mounting. This takes a comma
96d4ce01 196 separated list of options. This
cdb788e4
LP
197 setting is optional.</para></listitem>
198 </varlistentry>
199
200 <varlistentry>
201 <term><varname>DirectoryMode=</varname></term>
202 <listitem><para>Directories of mount
203 points (and any parent directories)
204 are automatically created if
205 needed. This option specifies the file
206 system access mode used when creating
dd1eb43b
LP
207 these directories. Takes an access
208 mode in octal notation. Defaults to
cdb788e4
LP
209 0755.</para></listitem>
210 </varlistentry>
211
212 <varlistentry>
213 <term><varname>TimeoutSec=</varname></term>
214 <listitem><para>Configures the time to
215 wait for the mount command to
b439c6ee 216 finish. If a command does not exit
cdb788e4
LP
217 within the configured time the mount
218 will be considered failed and be shut
219 down again. All commands still running
220 will be terminated forcibly via
221 SIGTERM, and after another delay of
222 this time with SIGKILL. (See
223 <option>KillMode=</option> below.)
224 Takes a unit-less value in seconds, or
225 a time span value such as "5min
226 20s". Pass 0 to disable the timeout
227 logic. Defaults to
ecb963cc 228 90s.</para></listitem>
cdb788e4
LP
229 </varlistentry>
230
231 <varlistentry>
232 <term><varname>KillMode=</varname></term>
233 <listitem><para>Specifies how
234 processes of this mount shall be
235 killed. One of
236 <option>control-group</option>,
cdb788e4
LP
237 <option>process</option>,
238 <option>none</option>.</para>
239
240 <para>This option is mostly equivalent
241 to the <option>KillMode=</option>
242 option of service files. See
243 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
244 for details.</para></listitem>
245 </varlistentry>
2292707d
LP
246
247 <varlistentry>
248 <term><varname>KillSignal=</varname></term>
249 <listitem><para>Specifies which signal
250 to use when killing a process of this
251 mount. Defaults to SIGTERM.
252 </para></listitem>
253 </varlistentry>
254
ba035df2
LP
255 <varlistentry>
256 <term><varname>SendSIGKILL=</varname></term>
257 <listitem><para>Specifies whether to
258 send SIGKILL to remaining processes
259 after a timeout, if the normal
260 shutdown procedure left processes of
261 the mount around. Takes a boolean
262 value. Defaults to "yes".
263 </para></listitem>
264 </varlistentry>
66b1a247 265
c485d3ba
LP
266 </variablelist>
267 </refsect1>
268
269 <refsect1>
270 <title>Compatibility Options</title>
271
272 <para>The following option is also available in the
273 <literal>[Mount]</literal> section, but exists purely
274 for compatibility reasons and should not be used in
275 newly written mount files.</para>
276
277 <variablelist>
66b1a247
LP
278 <varlistentry>
279 <term><varname>FsckPassNo=</varname></term>
280
281 <listitem><para>The pass number for
282 the file system checking service for
283 this mount. See
284 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
285 for more information on this setting.
286 </para></listitem>
287 </varlistentry>
cdb788e4
LP
288 </variablelist>
289 </refsect1>
290
291 <refsect1>
292 <title>See Also</title>
293 <para>
f3e219a2 294 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
cdb788e4
LP
295 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
296 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
297 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
66b1a247 298 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
cdb788e4 299 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
059b37cc
LP
300 <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
301 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
cdb788e4
LP
302 </para>
303 </refsect1>
304
305</refentry>