]>
Commit | Line | Data |
---|---|---|
1 | <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*--> | |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
4 | ||
5 | <!-- | |
6 | This file is part of systemd. | |
7 | ||
8 | Copyright 2016 Lennart Poettering | |
9 | ||
10 | systemd is free software; you can redistribute it and/or modify it | |
11 | under the terms of the GNU Lesser General Public License as published by | |
12 | the Free Software Foundation; either version 2.1 of the License, or | |
13 | (at your option) any later version. | |
14 | ||
15 | systemd is distributed in the hope that it will be useful, but | |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | Lesser General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU Lesser General Public License | |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
22 | --> | |
23 | ||
24 | <refentry id="systemd-mount" | |
25 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
26 | ||
27 | <refentryinfo> | |
28 | <title>systemd-mount</title> | |
29 | <productname>systemd</productname> | |
30 | ||
31 | <authorgroup> | |
32 | <author> | |
33 | <contrib>Developer</contrib> | |
34 | <firstname>Lennart</firstname> | |
35 | <surname>Poettering</surname> | |
36 | <email>lennart@poettering.net</email> | |
37 | </author> | |
38 | </authorgroup> | |
39 | </refentryinfo> | |
40 | ||
41 | <refmeta> | |
42 | <refentrytitle>systemd-mount</refentrytitle> | |
43 | <manvolnum>1</manvolnum> | |
44 | </refmeta> | |
45 | ||
46 | <refnamediv> | |
47 | <refname>systemd-mount</refname> | |
48 | <refname>systemd-umount</refname> | |
49 | <refpurpose>Establish and destroy transient mount or auto-mount points</refpurpose> | |
50 | </refnamediv> | |
51 | ||
52 | <refsynopsisdiv> | |
53 | <cmdsynopsis> | |
54 | <command>systemd-mount</command> | |
55 | <arg choice="opt" rep="repeat"><replaceable>OPTIONS</replaceable></arg> | |
56 | <arg choice="plain"><replaceable>WHAT</replaceable></arg> | |
57 | <arg choice="opt"><replaceable>WHERE</replaceable></arg> | |
58 | </cmdsynopsis> | |
59 | <cmdsynopsis> | |
60 | <command>systemd-mount</command> | |
61 | <arg choice="opt" rep="repeat"><replaceable>OPTIONS</replaceable></arg> | |
62 | <arg choice="plain"><option>--list</option></arg> | |
63 | </cmdsynopsis> | |
64 | <cmdsynopsis> | |
65 | <command>systemd-umount</command> | |
66 | <arg choice="opt" rep="repeat"><replaceable>OPTIONS</replaceable></arg> | |
67 | <arg choice="plain" rep="repeat"><replaceable>WHERE</replaceable></arg> | |
68 | </cmdsynopsis> | |
69 | </refsynopsisdiv> | |
70 | ||
71 | <refsect1> | |
72 | <title>Description</title> | |
73 | ||
74 | <para><command>systemd-mount</command> may be used to create and start a transient <filename>.mount</filename> or | |
75 | <filename>.automount</filename> unit of the file system <replaceable>WHAT</replaceable> on the mount point | |
76 | <replaceable>WHERE</replaceable>.</para> | |
77 | ||
78 | <para>In many ways, <command>systemd-mount</command> is similar to the lower-level | |
79 | <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> command, however instead | |
80 | of executing the mount operation directly and immediately, <command>systemd-mount</command> schedules it through | |
81 | the service manager job queue, so that it may pull in further dependencies (such as parent mounts, or a file system | |
82 | checker to execute a priori), and may make use of the auto-mounting logic.</para> | |
83 | ||
84 | <para>The command takes either one or two arguments. If only one argument is specified it should refer to a block | |
85 | device containing a file system (e.g. <literal>/dev/sdb1</literal>), which is then probed for a label and other | |
86 | metadata, and is mounted to a directory whose name is generated from the label. In this mode the block device must | |
87 | exist at the time of invocation of the command, so that it may be probed. If the device is found to be a removable | |
88 | block device (e.g. a USB stick) an automount point instead of a regular mount point is created (i.e. the | |
89 | <option>--automount=</option> option is implied, see below).</para> | |
90 | ||
91 | <para>If two arguments are specified the first indicates the mount source (the <replaceable>WHAT</replaceable>) and | |
92 | the second indicates the path to mount it on (the <replaceable>WHERE</replaceable>). In this mode no probing of the | |
93 | source is attempted, and a backing device node doesn't have to exist yet. However, if this mode is combined with | |
94 | <option>--discover</option>, device node probing for additional metadata is enabled, and – much like in the | |
95 | single-argument case discussed above – the specified device has to exist at the time of invocation of the | |
96 | command.</para> | |
97 | ||
98 | <para>Use the <option>--list</option> command to show a terse table of all local, known block devices with file | |
99 | systems that may be mounted with this command.</para> | |
100 | ||
101 | <para><command>systemd-umount</command> can be used to unmount a mount or automount point. It is the same | |
102 | as <command>systemd-mount</command> <option>--unmount</option>.</para> | |
103 | </refsect1> | |
104 | ||
105 | <refsect1> | |
106 | <title>Options</title> | |
107 | ||
108 | <para>The following options are understood:</para> | |
109 | ||
110 | <variablelist> | |
111 | ||
112 | <varlistentry> | |
113 | <term><option>--no-block</option></term> | |
114 | ||
115 | <listitem> | |
116 | <para>Do not synchronously wait for the requested operation to finish. If this is not specified, the job will | |
117 | be verified, enqueued and <command>systemd-mount</command> will wait until the mount or automount unit's | |
118 | start-up is completed. By passing this argument, it is only verified and enqueued.</para> | |
119 | </listitem> | |
120 | </varlistentry> | |
121 | ||
122 | <xi:include href="standard-options.xml" xpointer="no-pager"/> | |
123 | <xi:include href="standard-options.xml" xpointer="no-ask-password"/> | |
124 | ||
125 | <varlistentry> | |
126 | <term><option>--quiet</option></term> | |
127 | <term><option>-q</option></term> | |
128 | ||
129 | <listitem><para>Suppresses additional informational output while running.</para></listitem> | |
130 | </varlistentry> | |
131 | ||
132 | <varlistentry> | |
133 | <term><option>--discover</option></term> | |
134 | ||
135 | <listitem><para>Enable probing of the mount source. This switch is implied if a single argument is specified on | |
136 | the command line. If passed, additional metadata is read from the device to enhance the unit to create. For | |
137 | example, a descriptive string for the transient units is generated from the file system label and device | |
138 | model. Moreover if a removable block device (e.g. USB stick) is detected an automount unit instead of a regular | |
139 | mount unit is created, with a short idle time-out, in order to ensure the file-system is placed in a clean | |
140 | state quickly after each access.</para></listitem> | |
141 | </varlistentry> | |
142 | ||
143 | <varlistentry> | |
144 | <term><option>--type=</option></term> | |
145 | <term><option>-t</option></term> | |
146 | ||
147 | <listitem><para>Specifies the file system type to mount (e.g. <literal>vfat</literal>, <literal>ext4</literal>, | |
148 | …). If omitted (or set to <literal>auto</literal>) the file system is determined automatically.</para></listitem> | |
149 | </varlistentry> | |
150 | ||
151 | <varlistentry> | |
152 | <term><option>--options=</option></term> | |
153 | <term><option>-o</option></term> | |
154 | ||
155 | <listitem><para>Additional mount options for the mount point.</para></listitem> | |
156 | </varlistentry> | |
157 | ||
158 | <varlistentry> | |
159 | <term><option>--fsck=</option></term> | |
160 | ||
161 | <listitem><para>Takes a boolean argument, defaults to on. Controls whether to run a file system check | |
162 | immediately before the mount operation. In the automount case (see <option>--automount=</option> below) the | |
163 | check will be run the moment the first access to the device is made, which might slightly delay the | |
164 | access.</para></listitem> | |
165 | </varlistentry> | |
166 | ||
167 | <varlistentry> | |
168 | <term><option>--description=</option></term> | |
169 | ||
170 | <listitem><para>Provide a description for the mount or automount unit. See <varname>Description=</varname> in | |
171 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
172 | </para></listitem> | |
173 | </varlistentry> | |
174 | ||
175 | <varlistentry> | |
176 | <term><option>--property=</option></term> | |
177 | <term><option>-p</option></term> | |
178 | ||
179 | <listitem><para>Sets a unit property for the mount unit that is created. This takes an assignment in the same | |
180 | format as <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s | |
181 | <command>set-property</command> command.</para> | |
182 | </listitem> | |
183 | </varlistentry> | |
184 | ||
185 | <varlistentry> | |
186 | <term><option>--automount=</option></term> | |
187 | ||
188 | <listitem><para>Takes a boolean argument. Controls whether to create an automount point or a regular mount | |
189 | point. If true an automount point is created that is backed by the actual file system at the time of first | |
190 | access. If false a plain mount point is created that is backed by the actual file system immediately. Automount | |
191 | points have the benefit that the file system stays unmounted and hence in clean state until it is first | |
192 | accessed. In automount mode the <option>--timeout-idle-sec=</option> switch (see below) may be used to ensure | |
193 | the mount point is unmounted automatically after the last access and an idle period passed.</para> | |
194 | ||
195 | <para>If this switch is not specified it defaults to false. If not specified and <option>--discover</option> is | |
196 | used (or only a single argument passed, which implies <option>--discover</option>, see above), and the file | |
197 | system block device is detected to be removable, it is set to true, in order to increase the chance that the | |
198 | file system is in a fully clean state if the device is unplugged abruptly.</para></listitem> | |
199 | </varlistentry> | |
200 | ||
201 | <varlistentry> | |
202 | <term><option>-A</option></term> | |
203 | ||
204 | <listitem><para>Equivalent to <option>--automount=yes</option>.</para></listitem> | |
205 | </varlistentry> | |
206 | ||
207 | <varlistentry> | |
208 | <term><option>--timeout-idle-sec=</option></term> | |
209 | ||
210 | <listitem><para>Takes a time value that controls the idle timeout in automount mode. If set to | |
211 | <literal>infinity</literal> (the default) no automatic unmounts are done. Otherwise the file system backing the | |
212 | automount point is detached after the last access and the idle timeout passed. See | |
213 | <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry> for details on | |
214 | the time syntax supported. This option has no effect if only a regular mount is established, and automounting | |
215 | is not used.</para> | |
216 | ||
217 | <para>Note that if <option>--discover</option> is used (or only a single argument passed, which implies | |
218 | <option>--discover</option>, see above), and the file system block device is detected to be removable, | |
219 | <option>--timeout-idle-sec=1s</option> is implied.</para></listitem> | |
220 | </varlistentry> | |
221 | ||
222 | <varlistentry> | |
223 | <term><option>--automount-property=</option></term> | |
224 | ||
225 | <listitem><para>Similar to <option>--property=</option>, but applies additional properties to the automount | |
226 | unit created, instead of the mount unit.</para></listitem> | |
227 | </varlistentry> | |
228 | ||
229 | <varlistentry> | |
230 | <term><option>--bind-device=</option></term> | |
231 | ||
232 | <listitem><para>Takes a boolean argument, defaults to off. This option only has an effect in automount mode, | |
233 | and controls whether the automount unit shall be bound to the backing device's lifetime. If enabled, the | |
234 | automount point will be removed automatically when the backing device vanishes. If disabled the automount point | |
235 | stays around, and subsequent accesses will block until backing device is replugged. This option has no effect | |
236 | in case of non-device mounts, such as network or virtual file system mounts.</para> | |
237 | ||
238 | <para>Note that if <option>--discover</option> is used (or only a single argument passed, which implies | |
239 | <option>--discover</option>, see above), and the file system block device is detected to be removable, this | |
240 | option is implied.</para></listitem> | |
241 | </varlistentry> | |
242 | ||
243 | <varlistentry> | |
244 | <term><option>--list</option></term> | |
245 | ||
246 | <listitem><para>Instead of establishing a mount or automount point, print a terse list of block devices | |
247 | containing file systems that may be mounted with <literal>systemd-mount</literal>, along with useful metadata | |
248 | such as labels, etc.</para></listitem> | |
249 | </varlistentry> | |
250 | ||
251 | <varlistentry> | |
252 | <term><option>-u</option></term> | |
253 | <term><option>--unmount</option></term> | |
254 | ||
255 | <listitem><para>Stop the mount and automount units corresponding to the specified mount points | |
256 | <replaceable>WHERE</replaceable>.</para> | |
257 | </listitem> | |
258 | </varlistentry> | |
259 | ||
260 | <xi:include href="user-system-options.xml" xpointer="user" /> | |
261 | <xi:include href="user-system-options.xml" xpointer="system" /> | |
262 | <xi:include href="user-system-options.xml" xpointer="host" /> | |
263 | <xi:include href="user-system-options.xml" xpointer="machine" /> | |
264 | ||
265 | <xi:include href="standard-options.xml" xpointer="help" /> | |
266 | <xi:include href="standard-options.xml" xpointer="version" /> | |
267 | </variablelist> | |
268 | ||
269 | </refsect1> | |
270 | ||
271 | <refsect1> | |
272 | <title>Exit status</title> | |
273 | ||
274 | <para>On success, 0 is returned, a non-zero failure | |
275 | code otherwise.</para> | |
276 | </refsect1> | |
277 | ||
278 | <refsect1> | |
279 | <title>The udev Database</title> | |
280 | ||
281 | <para>If <option>--discover</option> is used, <command>systemd-mount</command> honors a couple of additional udev | |
282 | properties of block devices:</para> | |
283 | ||
284 | <variablelist class='udev-directives'> | |
285 | <varlistentry> | |
286 | <term><varname>SYSTEMD_MOUNT_OPTIONS=</varname></term> | |
287 | ||
288 | <listitem><para>The mount options to use, if <option>--options=</option> is not used.</para></listitem> | |
289 | </varlistentry> | |
290 | ||
291 | <varlistentry> | |
292 | <term><varname>SYSTEMD_MOUNT_WHERE=</varname></term> | |
293 | ||
294 | <listitem><para>The file system path to place the mount point at, instead of the automatically generated | |
295 | one.</para></listitem> | |
296 | </varlistentry> | |
297 | </variablelist> | |
298 | </refsect1> | |
299 | ||
300 | <refsect1> | |
301 | <title>See Also</title> | |
302 | <para> | |
303 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
304 | <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
305 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
306 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
307 | <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
308 | <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
309 | <citerefentry><refentrytitle>systemd-run</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
310 | </para> | |
311 | </refsect1> | |
312 | ||
313 | </refentry> |