]> git.proxmox.com Git - systemd.git/blob - man/systemd.mount.html
Imported Upstream version 221
[systemd.git] / man / systemd.mount.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd.mount</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21
22 <span style="float:right">systemd 221</span><hr><div class="refentry"><a name="systemd.mount"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd.mount — Mount unit configuration</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename"><em class="replaceable"><code>mount</code></em>.mount</code></p></div><div class="refsect1"><a name="idm47658415213840"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p>A unit configuration file whose name ends in
23 "<code class="literal">.mount</code>" encodes information about a file system
24 mount point controlled and supervised by systemd.</p><p>This man page lists the configuration options specific to
25 this unit type. See
26 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
27 for the common options of all unit configuration files. The common
28 configuration items are configured in the generic [Unit] and
29 [Install] sections. The mount specific configuration options are
30 configured in the [Mount] section.</p><p>Additional options are listed in
31 <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>,
32 which define the execution environment the
33 <a href="http://man7.org/linux/man-pages/man8/mount.8.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>
34 binary is executed in, and in
35 <a href="systemd.kill.html"><span class="citerefentry"><span class="refentrytitle">systemd.kill</span>(5)</span></a>,
36 which define the way the processes are terminated, and in
37 <a href="systemd.resource-control.html"><span class="citerefentry"><span class="refentrytitle">systemd.resource-control</span>(5)</span></a>,
38 which configure resource control settings for the processes of the
39 service. Note that the User= and Group= options are not
40 particularly useful for mount units specifying a
41 "<code class="literal">Type=</code>" option or using configuration not
42 specified in <code class="filename">/etc/fstab</code>;
43 <a href="http://man7.org/linux/man-pages/man8/mount.8.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>
44 will refuse options that are not listed in
45 <code class="filename">/etc/fstab</code> if it is not run as UID 0.</p><p>Mount units must be named after the mount point directories
46 they control. Example: the mount point
47 <code class="filename">/home/lennart</code> must be
48 configured in a unit file <code class="filename">home-lennart.mount</code>.
49 For details about the escaping logic used to convert a file system
50 path to a unit name, see
51 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>.</p><p>Optionally, a mount unit may be accompanied by an automount
52 unit, to allow on-demand or parallelized mounting. See
53 <a href="systemd.automount.html"><span class="citerefentry"><span class="refentrytitle">systemd.automount</span>(5)</span></a>.</p><p>If a mount point is beneath another mount point in the file
54 system hierarchy, a dependency between both units is created
55 automatically.</p><p>Mount points created at runtime (independently of unit files
56 or <code class="filename">/etc/fstab</code>) will be monitored by systemd
57 and appear like any other mount unit in systemd. See
58 <code class="filename">/proc/self/mountinfo</code> description in
59 <a href="http://man7.org/linux/man-pages/man5/proc.5.html"><span class="citerefentry"><span class="refentrytitle">proc</span>(5)</span></a>.
60 </p><p>Some file systems have special semantics as API file systems
61 for kernel-to-userspace and userspace-to-userspace interfaces. Some
62 of them may not be changed via mount units, and cannot be
63 disabled. For a longer discussion see <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems" target="_top">API
64 File Systems</a>.</p></div><div class="refsect1"><a name="idm47658410241920"></a><h2 id="fstab"><code class="filename">fstab</code><a class="headerlink" title="Permalink to this headline" href="#fstab"></a></h2><p>Mount units may either be configured via unit files, or via
65 <code class="filename">/etc/fstab</code> (see
66 <a href="http://man7.org/linux/man-pages/man5/fstab.5.html"><span class="citerefentry"><span class="refentrytitle">fstab</span>(5)</span></a>
67 for details). Mounts listed in <code class="filename">/etc/fstab</code>
68 will be converted into native units dynamically at boot and when
69 the configuration of the system manager is reloaded. In general,
70 configuring mount points through <code class="filename">/etc/fstab</code>
71 is the preferred approach. See
72 <a href="systemd-fstab-generator.html"><span class="citerefentry"><span class="refentrytitle">systemd-fstab-generator</span>(8)</span></a>
73 for details about the conversion.</p><p>When reading <code class="filename">/etc/fstab</code> a few special
74 mount options are understood by systemd which influence how
75 dependencies are created for mount points. systemd will create a
76 dependency of type <code class="option">Wants</code> or
77 <code class="option">Requires</code> (see option <code class="option">nofail</code>
78 below), from either <code class="filename">local-fs.target</code> or
79 <code class="filename">remote-fs.target</code>, depending whether the file
80 system is local or remote.</p><div class="variablelist"><dl class="variablelist"><dt id="x-systemd.requires="><span class="term"><code class="option">x-systemd.requires=</code></span><a class="headerlink" title="Permalink to this term" href="#x-systemd.requires="></a></dt><dd><p>Configures a <code class="varname">Requires=</code> and
81 an <code class="varname">After=</code> dependency between the created
82 mount unit and another systemd unit, such as a device or mount
83 unit. The argument should be a unit name, or an absolute path
84 to a device node or mount point. This option may be specified
85 more than once. This option is particularly useful for mount
86 point declarations that need an additional device to be around
87 (such as an external journal device for journal file systems)
88 or an additional mount to be in place (such as an overlay file
89 system that merges multiple mount points). See
90 <code class="varname">After=</code> and <code class="varname">Requires=</code> in
91 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
92 for details.</p></dd><dt id="x-systemd.requires-mounts-for="><span class="term"><code class="option">x-systemd.requires-mounts-for=</code></span><a class="headerlink" title="Permalink to this term" href="#x-systemd.requires-mounts-for="></a></dt><dd><p>Configures a
93 <code class="varname">RequiresMountsFor=</code> dependency between the
94 created mount unit and other mount units. The argument must be
95 an absolute path. This option may be specified more than once.
96 See <code class="varname">RequiresMountsFor=</code> in
97 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
98 for details.</p></dd><dt id="x-systemd.automount"><span class="term"><code class="option">x-systemd.automount</code></span><a class="headerlink" title="Permalink to this term" href="#x-systemd.automount"></a></dt><dd><p>An automount unit will be created for the file
99 system. See
100 <a href="systemd.automount.html"><span class="citerefentry"><span class="refentrytitle">systemd.automount</span>(5)</span></a>
101 for details.</p></dd><dt id="x-systemd.idle-timeout="><span class="term"><code class="option">x-systemd.idle-timeout=</code></span><a class="headerlink" title="Permalink to this term" href="#x-systemd.idle-timeout="></a></dt><dd><p>Configures the idleness timeout of the
102 automount unit. See <code class="varname">TimeoutIdleSec=</code> in
103 <a href="systemd.automount.html"><span class="citerefentry"><span class="refentrytitle">systemd.automount</span>(5)</span></a>
104 for details.</p></dd><dt id="x-systemd.device-timeout="><span class="term"><code class="option">x-systemd.device-timeout=</code></span><a class="headerlink" title="Permalink to this term" href="#x-systemd.device-timeout="></a></dt><dd><p>Configure how long systemd should wait for a
105 device to show up before giving up on an entry from
106 <code class="filename">/etc/fstab</code>. Specify a time in seconds or
107 explicitly append a unit as "<code class="literal">s</code>",
108 "<code class="literal">min</code>", "<code class="literal">h</code>",
109 "<code class="literal">ms</code>".</p><p>Note that this option can only be used in
110 <code class="filename">/etc/fstab</code>, and will be
111 ignored when part of <code class="varname">Options=</code>
112 setting in a unit file.</p></dd><dt id="noauto"><span class="term"><code class="option">noauto</code>, </span><span class="term"><code class="option">auto</code></span><a class="headerlink" title="Permalink to this term" href="#noauto"></a></dt><dd><p>With <code class="option">noauto</code>, this mount will
113 not be added as a dependency for
114 <code class="filename">local-fs.target</code> or
115 <code class="filename">remote-fs.target</code>. This means that it will
116 not be mounted automatically during boot, unless it is pulled
117 in by some other unit. Option <code class="option">auto</code> has the
118 opposite meaning and is the default.</p></dd><dt id="nofail"><span class="term"><code class="option">nofail</code></span><a class="headerlink" title="Permalink to this term" href="#nofail"></a></dt><dd><p>With <code class="option">nofail</code> this mount will
119 be only wanted, not required, by
120 <code class="filename">local-fs.target</code> or
121 <code class="filename">remote-fs.target</code>. This means that the
122 boot will continue even if this mount point is not mounted
123 successfully.</p></dd><dt id="x-initrd.mount"><span class="term"><code class="option">x-initrd.mount</code></span><a class="headerlink" title="Permalink to this term" href="#x-initrd.mount"></a></dt><dd><p>An additional filesystem to be mounted in the
124 initramfs. See <code class="filename">initrd-fs.target</code>
125 description in
126 <a href="systemd.special.html"><span class="citerefentry"><span class="refentrytitle">systemd.special</span>(7)</span></a>.
127 </p></dd></dl></div><p>If a mount point is configured in both
128 <code class="filename">/etc/fstab</code> and a unit file that is stored
129 below <code class="filename">/usr</code>, the former will take precedence.
130 If the unit file is stored below <code class="filename">/etc</code>, it
131 will take precedence. This means: native unit files take
132 precedence over traditional configuration files, but this is
133 superseded by the rule that configuration in
134 <code class="filename">/etc</code> will always take precedence over
135 configuration in <code class="filename">/usr</code>.</p></div><div class="refsect1"><a name="idm47658410199536"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options"></a></h2><p>Mount files must include a [Mount] section, which carries
136 information about the file system mount points it supervises. A
137 number of options that may be used in this section are shared with
138 other unit types. These options are documented in
139 <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>
140 and
141 <a href="systemd.kill.html"><span class="citerefentry"><span class="refentrytitle">systemd.kill</span>(5)</span></a>.
142 The options specific to the [Mount] section of mount units are the
143 following:</p><div class="variablelist"><dl class="variablelist"><dt id="What="><span class="term"><code class="varname">What=</code></span><a class="headerlink" title="Permalink to this term" href="#What="></a></dt><dd><p>Takes an absolute path of a device node, file
144 or other resource to mount. See
145 <a href="http://man7.org/linux/man-pages/man8/mount.8.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>
146 for details. If this refers to a device node, a dependency on
147 the respective device unit is automatically created. (See
148 <a href="systemd.device.html"><span class="citerefentry"><span class="refentrytitle">systemd.device</span>(5)</span></a>
149 for more information.) This option is
150 mandatory.</p></dd><dt id="Where="><span class="term"><code class="varname">Where=</code></span><a class="headerlink" title="Permalink to this term" href="#Where="></a></dt><dd><p>Takes an absolute path of a directory of the
151 mount point. If the mount point does not exist at the time of
152 mounting, it is created. This string must be reflected in the
153 unit filename. (See above.) This option is
154 mandatory.</p></dd><dt id="Type="><span class="term"><code class="varname">Type=</code></span><a class="headerlink" title="Permalink to this term" href="#Type="></a></dt><dd><p>Takes a string for the file system type. See
155 <a href="http://man7.org/linux/man-pages/man8/mount.8.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>
156 for details. This setting is optional.</p></dd><dt id="Options="><span class="term"><code class="varname">Options=</code></span><a class="headerlink" title="Permalink to this term" href="#Options="></a></dt><dd><p>Mount options to use when mounting. This takes
157 a comma-separated list of options. This setting is
158 optional.</p></dd><dt id="SloppyOptions="><span class="term"><code class="varname">SloppyOptions=</code></span><a class="headerlink" title="Permalink to this term" href="#SloppyOptions="></a></dt><dd><p>Takes a boolean argument. If true, parsing of
159 the options specified in <code class="varname">Options=</code> is
160 relaxed, and unknown mount options are tolerated. This
161 corresponds with
162 <a href="http://man7.org/linux/man-pages/man8/mount.8.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>'s
163 <em class="parameter"><code>-s</code></em> switch. Defaults to
164 off.</p></dd><dt id="DirectoryMode="><span class="term"><code class="varname">DirectoryMode=</code></span><a class="headerlink" title="Permalink to this term" href="#DirectoryMode="></a></dt><dd><p>Directories of mount points (and any parent
165 directories) are automatically created if needed. This option
166 specifies the file system access mode used when creating these
167 directories. Takes an access mode in octal notation. Defaults
168 to 0755.</p></dd><dt id="TimeoutSec="><span class="term"><code class="varname">TimeoutSec=</code></span><a class="headerlink" title="Permalink to this term" href="#TimeoutSec="></a></dt><dd><p>Configures the time to wait for the mount
169 command to finish. If a command does not exit within the
170 configured time, the mount will be considered failed and be
171 shut down again. All commands still running will be terminated
172 forcibly via <code class="constant">SIGTERM</code>, and after another
173 delay of this time with <code class="constant">SIGKILL</code>. (See
174 <code class="option">KillMode=</code> in
175 <a href="systemd.kill.html"><span class="citerefentry"><span class="refentrytitle">systemd.kill</span>(5)</span></a>.)
176 Takes a unit-less value in seconds, or a time span value such
177 as "5min 20s". Pass 0 to disable the timeout logic. The
178 default value is set from the manager configuration file's
179 <code class="varname">DefaultTimeoutStart=</code>
180 variable.</p></dd></dl></div><p>Check
181 <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>
182 and
183 <a href="systemd.kill.html"><span class="citerefentry"><span class="refentrytitle">systemd.kill</span>(5)</span></a>
184 for more settings.</p></div><div class="refsect1"><a name="idm47658410175200"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
185 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
186 <a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
187 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>,
188 <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>,
189 <a href="systemd.kill.html"><span class="citerefentry"><span class="refentrytitle">systemd.kill</span>(5)</span></a>,
190 <a href="systemd.resource-control.html"><span class="citerefentry"><span class="refentrytitle">systemd.resource-control</span>(5)</span></a>,
191 <a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a>,
192 <a href="systemd.device.html"><span class="citerefentry"><span class="refentrytitle">systemd.device</span>(5)</span></a>,
193 <a href="http://man7.org/linux/man-pages/man5/proc.5.html"><span class="citerefentry"><span class="refentrytitle">proc</span>(5)</span></a>,
194 <a href="http://man7.org/linux/man-pages/man8/mount.8.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>,
195 <a href="systemd-fstab-generator.html"><span class="citerefentry"><span class="refentrytitle">systemd-fstab-generator</span>(8)</span></a>,
196 <a href="systemd.directives.html"><span class="citerefentry"><span class="refentrytitle">systemd.directives</span>(7)</span></a>
197 </p></div></div></body></html>