]> git.proxmox.com Git - systemd.git/blob - man/systemd.mount.html
Imported Upstream version 208
[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 <a href="../libudev/index.html">libudev </a>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 208</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="idm274692535648"></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
24 a file system mount point controlled and supervised by
25 systemd.</p><p>This man page lists the configuration options
26 specific to this unit type. See
27 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>
28 for the common options of all unit configuration
29 files. The common configuration items are configured
30 in the generic [Unit] and [Install] sections. The
31 mount specific configuration options are configured
32 in the [Mount] section.</p><p>Additional options are listed in
33 <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>,
34 which define the execution environment the
35 <a href="mount.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>
36 binary is executed in, and in
37 <a href="systemd.kill.html"><span class="citerefentry"><span class="refentrytitle">systemd.kill</span>(5)</span></a>,
38 which define the way the processes are terminated, and
39 in
40 <a href="systemd.resource-control.html"><span class="citerefentry"><span class="refentrytitle">systemd.resource-control</span>(5)</span></a>,
41 which configure resource control settings for the
42 processes of the service. Note that the User= and
43 Group= options are not particularly useful for mount
44 units specifying a "<code class="literal">Type=</code>" option or
45 using configuration not specified in
46 <code class="filename">/etc/fstab</code>;
47 <a href="mount.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>
48 will refuse options that are not listed in
49 <code class="filename">/etc/fstab</code> if it is not run as
50 UID 0.</p><p>Mount units must be named after the mount point
51 directories they control. Example: the mount point
52 <code class="filename">/home/lennart</code> must be configured
53 in a unit file
54 <code class="filename">home-lennart.mount</code>. For details
55 about the escaping logic used to convert a file system
56 path to a unit name see
57 <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
58 an automount unit, to allow on-demand or parallelized
59 mounting. See
60 <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
61 in the file system hierarchy, a dependency between both
62 units is created automatically.</p><p>Mount points created at runtime (independently of
63 unit files or <code class="filename">/etc/fstab</code>) will be
64 monitored by systemd and appear like any other mount
65 unit in systemd.
66 See <code class="filename">/proc/self/mountinfo</code> description
67 in <a href="proc.html"><span class="citerefentry"><span class="refentrytitle">proc</span>(5)</span></a>.
68 </p><p>Some file systems have special semantics as API
69 file systems for kernel-to-userspace and
70 userspace-to-userpace interfaces. Some of them may not
71 be changed via mount units, and cannot be disabled.
72 For a longer discussion see <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems" target="_top">API
73 File Systems</a>.</p></div><div class="refsect1"><a name="idm274692592320"></a><h2 id="/etc/fstab"><code class="filename">/etc/fstab</code><a class="headerlink" title="Permalink to this headline" href="#/etc/fstab"></a></h2><p>Mount units may either be configured via unit
74 files, or via <code class="filename">/etc/fstab</code> (see
75 <a href="fstab.html"><span class="citerefentry"><span class="refentrytitle">fstab</span>(5)</span></a>
76 for details). Mounts listed in
77 <code class="filename">/etc/fstab</code> will be converted into
78 native units dynamically at boot and when the
79 configuration of the system manager is reloaded. See
80 <a href="systemd-fstab-generator.html"><span class="citerefentry"><span class="refentrytitle">systemd-fstab-generator</span>(8)</span></a>
81 for details about the conversion.</p><p>When reading <code class="filename">/etc/fstab</code> a
82 few special mount options are understood by systemd
83 which influence how dependencies are created for mount
84 points from <code class="filename">/etc/fstab</code>. systemd
85 will create a dependency of type
86 <code class="option">Wants</code> from either
87 <code class="filename">local-fs.target</code> or
88 <code class="filename">remote-fs.target</code>, depending
89 whether the file system is local or remote. If
90 <code class="option">x-systemd.automount</code> is set, an
91 automount unit will be created for the file
92 system. See
93 <a href="systemd.automount.html"><span class="citerefentry"><span class="refentrytitle">systemd.automount</span>(5)</span></a>
94 for details. If
95 <code class="option">x-systemd.device-timeout=</code> is
96 specified, it may be used to configure how long systemd
97 should wait for a device to show up before giving up
98 on an entry from
99 <code class="filename">/etc/fstab</code>. Specify a time in
100 seconds or explicitly specify a unit as
101 "<code class="literal">s</code>", "<code class="literal">min</code>",
102 "<code class="literal">h</code>", "<code class="literal">ms</code>".</p><p>If a mount point is configured in both
103 <code class="filename">/etc/fstab</code> and a unit file that
104 is stored below <code class="filename">/usr</code>, the former
105 will take precedence. If the unit file is stored below
106 <code class="filename">/etc</code>, it will take
107 precedence. This means: native unit files take
108 precedence over traditional configuration files, but
109 this is superseded by the rule that configuration in
110 <code class="filename">/etc</code> will always take precedence
111 over configuration in
112 <code class="filename">/usr</code>.</p></div><div class="refsect1"><a name="idm274692566288"></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,
113 which carries information about the file system mount points it
114 supervises. A number of options that may be used in
115 this section are shared with other unit types. These
116 options are documented in
117 <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>
118 and
119 <a href="systemd.kill.html"><span class="citerefentry"><span class="refentrytitle">systemd.kill</span>(5)</span></a>. The
120 options specific to the [Mount] section of mount
121 units are the 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
122 of a device node, file or other
123 resource to mount. See
124 <a href="mount.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>
125 for details. If this refers to a
126 device node, a dependency on the
127 respective device unit is
128 automatically created. (See
129 <a href="systemd.device.html"><span class="citerefentry"><span class="refentrytitle">systemd.device</span>(5)</span></a> for more information.)
130 This option is
131 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
132 of a directory of the mount point. If
133 the mount point does not exist at the
134 time of mounting, it is created. This
135 string must be reflected in the unit
136 filename. (See above.) This option is
137 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
138 file system type. See
139 <a href="mount.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>
140 for details. This setting is
141 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
142 when mounting. This takes a
143 comma-separated list of options. This
144 setting is optional.</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
145 points (and any parent directories)
146 are automatically created if
147 needed. This option specifies the file
148 system access mode used when creating
149 these directories. Takes an access
150 mode in octal notation. Defaults to
151 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
152 wait for the mount command to
153 finish. If a command does not exit
154 within the configured time, the mount
155 will be considered failed and be shut
156 down again. All commands still running
157 will be terminated forcibly via
158 <code class="constant">SIGTERM</code>, and after another delay of
159 this time with <code class="constant">SIGKILL</code>. (See
160 <code class="option">KillMode=</code> in
161 <a href="systemd.kill.html"><span class="citerefentry"><span class="refentrytitle">systemd.kill</span>(5)</span></a>.)
162 Takes a unit-less value in seconds, or
163 a time span value such as "5min
164 20s". Pass 0 to disable the timeout
165 logic. Defaults to
166 90s.</p></dd></dl></div><p>Check
167 <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>
168 and
169 <a href="systemd.kill.html"><span class="citerefentry"><span class="refentrytitle">systemd.kill</span>(5)</span></a>
170 for more settings.</p></div><div class="refsect1"><a name="idm274687630032"></a><h2 id="Compatibility Options">Compatibility Options<a class="headerlink" title="Permalink to this headline" href="#Compatibility%20Options"></a></h2><p>The following option is also available in the
171 "<code class="literal">[Mount]</code>" section, but exists purely
172 for compatibility reasons and should not be used in
173 newly written mount files.</p><div class="variablelist"><dl class="variablelist"><dt id="FsckPassNo="><span class="term"><code class="varname">FsckPassNo=</code></span><a class="headerlink" title="Permalink to this term" href="#FsckPassNo="></a></dt><dd><p>The pass number for
174 the file system checking service for
175 this mount. See
176 <a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a>
177 for more information on this setting.
178 </p></dd></dl></div></div><div class="refsect1"><a name="idm274687624992"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
179 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
180 <a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(8)</span></a>,
181 <a href="systemd.unit.html"><span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span></a>,
182 <a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>,
183 <a href="systemd.kill.html"><span class="citerefentry"><span class="refentrytitle">systemd.kill</span>(5)</span></a>,
184 <a href="systemd.resource-control.html"><span class="citerefentry"><span class="refentrytitle">systemd.resource-control</span>(5)</span></a>,
185 <a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a>,
186 <a href="systemd.device.html"><span class="citerefentry"><span class="refentrytitle">systemd.device</span>(5)</span></a>,
187 <a href="proc.html"><span class="citerefentry"><span class="refentrytitle">proc</span>(5)</span></a>,
188 <a href="mount.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a>,
189 <a href="systemd-fstab-generator.html"><span class="citerefentry"><span class="refentrytitle">systemd-fstab-generator</span>(8)</span></a>,
190 <a href="systemd.directives.html"><span class="citerefentry"><span class="refentrytitle">systemd.directives</span>(7)</span></a>
191 </p></div></div></body></html>