1SYSTEMD-MOUNT(1)                 systemd-mount                SYSTEMD-MOUNT(1)
2
3
4

NAME

6       systemd-mount, systemd-umount - Establish and destroy transient mount
7       or auto-mount points
8

SYNOPSIS

10       systemd-mount [OPTIONS...] WHAT [WHERE]
11
12       systemd-mount [OPTIONS...] --list
13
14       systemd-mount [OPTIONS...] --umount WHAT|WHERE...
15

DESCRIPTION

17       systemd-mount may be used to create and start a transient .mount or
18       .automount unit of the file system WHAT on the mount point WHERE.
19
20       In many ways, systemd-mount is similar to the lower-level mount(8)
21       command, however instead of executing the mount operation directly and
22       immediately, systemd-mount schedules it through the service manager job
23       queue, so that it may pull in further dependencies (such as parent
24       mounts, or a file system checker to execute a priori), and may make use
25       of the auto-mounting logic.
26
27       The command takes either one or two arguments. If only one argument is
28       specified it should refer to a block device or regular file containing
29       a file system (e.g.  "/dev/sdb1" or "/path/to/disk.img"). If it is a
30       block device, which is then probed for a label and other metadata, and
31       is mounted to a directory whose name is generated from the label. In
32       this mode the block device must exist at the time of invocation of the
33       command, so that it may be probed. If the device is found to be a
34       removable block device (e.g. a USB stick) an automount point instead of
35       a regular mount point is created (i.e. the --automount= option is
36       implied, see below).
37
38       If two arguments are specified the first indicates the mount source
39       (the WHAT) and the second indicates the path to mount it on (the
40       WHERE). In this mode no probing of the source is attempted, and a
41       backing device node doesn't have to exist yet. However, if this mode is
42       combined with --discover, device node probing for additional metadata
43       is enabled, and – much like in the single-argument case discussed above
44       – the specified device has to exist at the time of invocation of the
45       command.
46
47       Use the --list command to show a terse table of all local, known block
48       devices with file systems that may be mounted with this command.
49
50       systemd-umount can be used to unmount a mount or automount point. It is
51       the same as systemd-mount --umount.
52

OPTIONS

54       The following options are understood:
55
56       --no-block
57           Do not synchronously wait for the requested operation to finish. If
58           this is not specified, the job will be verified, enqueued and
59           systemd-mount will wait until the mount or automount unit's
60           start-up is completed. By passing this argument, it is only
61           verified and enqueued.
62
63       --no-pager
64           Do not pipe output into a pager.
65
66       --no-ask-password
67           Do not query the user for authentication for privileged operations.
68
69       --quiet, -q
70           Suppresses additional informational output while running.
71
72       --discover
73           Enable probing of the mount source. This switch is implied if a
74           single argument is specified on the command line. If passed,
75           additional metadata is read from the device to enhance the unit to
76           create. For example, a descriptive string for the transient units
77           is generated from the file system label and device model. Moreover
78           if a removable block device (e.g. USB stick) is detected an
79           automount unit instead of a regular mount unit is created, with a
80           short idle time-out, in order to ensure the file-system is placed
81           in a clean state quickly after each access.
82
83       --type=, -t
84           Specifies the file system type to mount (e.g.  "vfat", "ext4",
85           ...). If omitted (or set to "auto") the file system is determined
86           automatically.
87
88       --options=, -o
89           Additional mount options for the mount point.
90
91       --owner=USER
92           Let the specified user USER own the mounted file system. This is
93           done by appending uid= and gid= options to the list of mount
94           options. Only certain file systems support this option.
95
96       --fsck=
97           Takes a boolean argument, defaults to on. Controls whether to run a
98           file system check immediately before the mount operation. In the
99           automount case (see --automount= below) the check will be run the
100           moment the first access to the device is made, which might slightly
101           delay the access.
102
103       --description=
104           Provide a description for the mount or automount unit. See
105           Description= in systemd.unit(5).
106
107       --property=, -p
108           Sets a unit property for the mount unit that is created. This takes
109           an assignment in the same format as systemctl(1)'s set-property
110           command.
111
112       --automount=
113           Takes a boolean argument. Controls whether to create an automount
114           point or a regular mount point. If true an automount point is
115           created that is backed by the actual file system at the time of
116           first access. If false a plain mount point is created that is
117           backed by the actual file system immediately. Automount points have
118           the benefit that the file system stays unmounted and hence in clean
119           state until it is first accessed. In automount mode the
120           --timeout-idle-sec= switch (see below) may be used to ensure the
121           mount point is unmounted automatically after the last access and an
122           idle period passed.
123
124           If this switch is not specified it defaults to false. If not
125           specified and --discover is used (or only a single argument passed,
126           which implies --discover, see above), and the file system block
127           device is detected to be removable, it is set to true, in order to
128           increase the chance that the file system is in a fully clean state
129           if the device is unplugged abruptly.
130
131       -A
132           Equivalent to --automount=yes.
133
134       --timeout-idle-sec=
135           Takes a time value that controls the idle timeout in automount
136           mode. If set to "infinity" (the default) no automatic unmounts are
137           done. Otherwise the file system backing the automount point is
138           detached after the last access and the idle timeout passed. See
139           systemd.time(7) for details on the time syntax supported. This
140           option has no effect if only a regular mount is established, and
141           automounting is not used.
142
143           Note that if --discover is used (or only a single argument passed,
144           which implies --discover, see above), and the file system block
145           device is detected to be removable, --timeout-idle-sec=1s is
146           implied.
147
148       --automount-property=
149           Similar to --property=, but applies additional properties to the
150           automount unit created, instead of the mount unit.
151
152       --bind-device=
153           Takes a boolean argument, defaults to off. This option only has an
154           effect in automount mode, and controls whether the automount unit
155           shall be bound to the backing device's lifetime. If enabled, the
156           automount point will be removed automatically when the backing
157           device vanishes. If disabled the automount point stays around, and
158           subsequent accesses will block until backing device is replugged.
159           This option has no effect in case of non-device mounts, such as
160           network or virtual file system mounts.
161
162           Note that if --discover is used (or only a single argument passed,
163           which implies --discover, see above), and the file system block
164           device is detected to be removable, this option is implied.
165
166       --list
167           Instead of establishing a mount or automount point, print a terse
168           list of block devices containing file systems that may be mounted
169           with "systemd-mount", along with useful metadata such as labels,
170           etc.
171
172       -u, --umount
173           Stop the mount and automount units corresponding to the specified
174           mount points WHERE or the devices WHAT.  systemd-mount with this
175           option or systemd-umount can take multiple arguments which can be
176           mount points, devices, /etc/fstab style node names, or backing
177           files corresponding to loop devices, like systemd-mount --umount
178           /path/to/umount /dev/sda1 UUID=xxxxxx-xxxx LABEL=xxxxx
179           /path/to/disk.img. Note that when -H or -M is specified, only
180           absolute paths to mount points are supported.
181
182       -G, --collect
183           Unload the transient unit after it completed, even if it failed.
184           Normally, without this option, all mount units that mount and
185           failed are kept in memory until the user explicitly resets their
186           failure state with systemctl reset-failed or an equivalent command.
187           On the other hand, units that stopped successfully are unloaded
188           immediately. If this option is turned on the "garbage collection"
189           of units is more aggressive, and unloads units regardless if they
190           exited successfully or failed. This option is a shortcut for
191           --property=CollectMode=inactive-or-failed, see the explanation for
192           CollectMode= in systemd.unit(5) for further information.
193
194       --user
195           Talk to the service manager of the calling user, rather than the
196           service manager of the system.
197
198       --system
199           Talk to the service manager of the system. This is the implied
200           default.
201
202       -H, --host=
203           Execute the operation remotely. Specify a hostname, or a username
204           and hostname separated by "@", to connect to. The hostname may
205           optionally be suffixed by a container name, separated by ":", which
206           connects directly to a specific container on the specified host.
207           This will use SSH to talk to the remote machine manager instance.
208           Container names may be enumerated with machinectl -H HOST.
209
210       -M, --machine=
211           Execute operation on a local container. Specify a container name to
212           connect to.
213
214       -h, --help
215           Print a short help text and exit.
216
217       --version
218           Print a short version string and exit.
219

EXIT STATUS

221       On success, 0 is returned, a non-zero failure code otherwise.
222

THE UDEV DATABASE

224       If --discover is used, systemd-mount honors a couple of additional udev
225       properties of block devices:
226
227       SYSTEMD_MOUNT_OPTIONS=
228           The mount options to use, if --options= is not used.
229
230       SYSTEMD_MOUNT_WHERE=
231           The file system path to place the mount point at, instead of the
232           automatically generated one.
233

SEE ALSO

235       systemd(1), mount(8), systemctl(1), systemd.unit(5), systemd.mount(5),
236       systemd.automount(5), systemd-run(1)
237
238
239
240systemd 239                                                   SYSTEMD-MOUNT(1)
Impressum