1SYSTEMD.MOUNT(5)                 systemd.mount                SYSTEMD.MOUNT(5)
2
3
4

NAME

6       systemd.mount - Mount unit configuration
7

SYNOPSIS

9       mount.mount
10

DESCRIPTION

12       A unit configuration file whose name ends in ".mount" encodes
13       information about a file system mount point controlled and supervised
14       by systemd.
15
16       This man page lists the configuration options specific to this unit
17       type. See systemd.unit(5) for the common options of all unit
18       configuration files. The common configuration items are configured in
19       the generic [Unit] and [Install] sections. The mount specific
20       configuration options are configured in the [Mount] section.
21
22       Additional options are listed in systemd.exec(5), which define the
23       execution environment the mount(8) program is executed in, and in
24       systemd.kill(5), which define the way the processes are terminated, and
25       in systemd.resource-control(5), which configure resource control
26       settings for the processes of the service.
27
28       Note that the options User= and Group= are not useful for mount units.
29       systemd passes two parameters to mount(8); the values of What= and
30       Where=. When invoked in this way, mount(8) does not read any options
31       from /etc/fstab, and must be run as UID 0.
32
33       Mount units must be named after the mount point directories they
34       control. Example: the mount point /home/lennart must be configured in a
35       unit file home-lennart.mount. For details about the escaping logic used
36       to convert a file system path to a unit name, see systemd.unit(5). Note
37       that mount units cannot be templated, nor is possible to add multiple
38       names to a mount unit by creating additional symlinks to it.
39
40       Optionally, a mount unit may be accompanied by an automount unit, to
41       allow on-demand or parallelized mounting. See systemd.automount(5).
42
43       Mount points created at runtime (independently of unit files or
44       /etc/fstab) will be monitored by systemd and appear like any other
45       mount unit in systemd. See /proc/self/mountinfo description in proc(5).
46
47       Some file systems have special semantics as API file systems for
48       kernel-to-userspace and userspace-to-userspace interfaces. Some of them
49       may not be changed via mount units, and cannot be disabled. For a
50       longer discussion see API File Systems[1].
51

AUTOMATIC DEPENDENCIES

53   Implicit Dependencies
54       The following dependencies are implicitly added:
55
56       ·   If a mount unit is beneath another mount unit in the file system
57           hierarchy, both a requirement dependency and an ordering dependency
58           between both units are created automatically.
59
60       ·   Block device backed file systems automatically gain BindsTo= and
61           After= type dependencies on the device unit encapsulating the block
62           device (see below).
63
64       ·   If traditional file system quota is enabled for a mount unit,
65           automatic Wants= and Before= dependencies on
66           systemd-quotacheck.service and quotaon.service are added.
67
68       ·   Additional implicit dependencies may be added as result of
69           execution and resource control parameters as documented in
70           systemd.exec(5) and systemd.resource-control(5).
71
72   Default Dependencies
73       The following dependencies are added unless DefaultDependencies=no is
74       set:
75
76       ·   All mount units acquire automatic Before= and Conflicts= on
77           umount.target in order to be stopped during shutdown.
78
79       ·   Mount units referring to local file systems automatically gain an
80           After= dependency on local-fs-pre.target.
81
82       ·   Network mount units automatically acquire After= dependencies on
83           remote-fs-pre.target, network.target and network-online.target.
84           Towards the latter a Wants= unit is added as well.
85
86       Mount units referring to local and network file systems are
87       distinguished by their file system type specification. In some cases
88       this is not sufficient (for example network block device based mounts,
89       such as iSCSI), in which case _netdev may be added to the mount option
90       string of the unit, which forces systemd to consider the mount unit a
91       network mount.
92

FSTAB

94       Mount units may either be configured via unit files, or via /etc/fstab
95       (see fstab(5) for details). Mounts listed in /etc/fstab will be
96       converted into native units dynamically at boot and when the
97       configuration of the system manager is reloaded. In general,
98       configuring mount points through /etc/fstab is the preferred approach.
99       See systemd-fstab-generator(8) for details about the conversion.
100
101       The NFS mount option bg for NFS background mounts as documented in
102       nfs(5) is detected by systemd-fstab-generator and the options are
103       transformed so that systemd fulfills the job-control implications of
104       that option. Specifically systemd-fstab-generator acts as though
105       "x-systemd.mount-timout=infinity,retry=10000" was prepended to the
106       option list, and "fg,nofail" was appended. Depending on specific
107       requirements, it may be appropriate to provide some of these options
108       explicitly, or to make use of the "x-systemd.automount" option
109       described below instead of using "bg".
110
111       When reading /etc/fstab a few special mount options are understood by
112       systemd which influence how dependencies are created for mount points.
113       systemd will create a dependency of type Wants= or Requires (see option
114       nofail below), from either local-fs.target or remote-fs.target,
115       depending whether the file system is local or remote.
116
117       x-systemd.requires=
118           Configures a Requires= and an After= dependency between the created
119           mount unit and another systemd unit, such as a device or mount
120           unit. The argument should be a unit name, or an absolute path to a
121           device node or mount point. This option may be specified more than
122           once. This option is particularly useful for mount point
123           declarations that need an additional device to be around (such as
124           an external journal device for journal file systems) or an
125           additional mount to be in place (such as an overlay file system
126           that merges multiple mount points). See After= and Requires= in
127           systemd.unit(5) for details.
128
129       x-systemd.before=, x-systemd.after=
130           Configures a Before= dependency or After= between the created mount
131           unit and another systemd unit, such as a mount unit. The argument
132           should be a unit name or an absolute path to a mount point. This
133           option may be specified more than once. This option is particularly
134           useful for mount point declarations with nofail option that are
135           mounted asynchronously but need to be mounted before or after some
136           unit start, for example, before local-fs.target unit. See Before=
137           and After= in systemd.unit(5) for details.
138
139       x-systemd.requires-mounts-for=
140           Configures a RequiresMountsFor= dependency between the created
141           mount unit and other mount units. The argument must be an absolute
142           path. This option may be specified more than once. See
143           RequiresMountsFor= in systemd.unit(5) for details.
144
145       x-systemd.device-bound
146           The block device backed file system will be upgraded to BindsTo=
147           dependency. This option is only useful when mounting file systems
148           manually with mount(8) as the default dependency in this case is
149           Requires=. This option is already implied by entries in /etc/fstab
150           or by mount units.
151
152       x-systemd.automount
153           An automount unit will be created for the file system. See
154           systemd.automount(5) for details.
155
156       x-systemd.idle-timeout=
157           Configures the idle timeout of the automount unit. See
158           TimeoutIdleSec= in systemd.automount(5) for details.
159
160       x-systemd.device-timeout=
161           Configure how long systemd should wait for a device to show up
162           before giving up on an entry from /etc/fstab. Specify a time in
163           seconds or explicitly append a unit such as "s", "min", "h", "ms".
164
165           Note that this option can only be used in /etc/fstab, and will be
166           ignored when part of the Options= setting in a unit file.
167
168       x-systemd.mount-timeout=
169           Configure how long systemd should wait for the mount command to
170           finish before giving up on an entry from /etc/fstab. Specify a time
171           in seconds or explicitly append a unit such as "s", "min", "h",
172           "ms".
173
174           Note that this option can only be used in /etc/fstab, and will be
175           ignored when part of the Options= setting in a unit file.
176
177           See TimeoutSec= below for details.
178
179       x-systemd.makefs
180           The file system or swap structure will be initialized on the
181           device. If the device is not "empty", i.e. it contains any
182           signature, the operation will be skipped. It is hence expected that
183           this option remains set even after the device has been initalized.
184
185           Note that this option can only be used in /etc/fstab, and will be
186           ignored when part of the Options= setting in a unit file.
187
188           See systemd-makefs@.service(8).
189
190           wipefs(8) may be used to remove any signatures from a block device
191           to force x-systemd.makefs to reinitialize the device.
192
193       x-systemd.growfs
194           The file system will be grown to occupy the full block device. If
195           the file system is already at maximum size, no action will be
196           performed. It is hence expected that this option remains set even
197           after the file system has been grown. Only certain file system
198           types are supported, see systemd-makefs@.service(8) for details.
199
200           Note that this option can only be used in /etc/fstab, and will be
201           ignored when part of the Options= setting in a unit file.
202
203       _netdev
204           Normally the file system type is used to determine if a mount is a
205           "network mount", i.e. if it should only be started after the
206           network is available. Using this option overrides this detection
207           and specifies that the mount requires network.
208
209           Network mount units are ordered between remote-fs-pre.target and
210           remote-fs.target, instead of local-fs-pre.target and
211           local-fs.target. They also pull in network-online.target and are
212           ordered after it and network.target.
213
214       noauto, auto
215           With noauto, the mount unit will not be added as a dependency for
216           local-fs.target or remote-fs.target. This means that it will not be
217           mounted automatically during boot, unless it is pulled in by some
218           other unit. The auto option has the opposite meaning and is the
219           default. Note that the noauto option has an effect on the mount
220           unit itself only — if x-systemd.automount is used (see above), then
221           the matching automount unit will still be pulled in by these
222           targets.
223
224       nofail
225           With nofail, this mount will be only wanted, not required, by
226           local-fs.target or remote-fs.target. This means that the boot will
227           continue even if this mount point is not mounted successfully.
228
229       x-initrd.mount
230           An additional filesystem to be mounted in the initramfs. See
231           initrd-fs.target description in systemd.special(7).
232
233       If a mount point is configured in both /etc/fstab and a unit file that
234       is stored below /usr, the former will take precedence. If the unit file
235       is stored below /etc, it will take precedence. This means: native unit
236       files take precedence over traditional configuration files, but this is
237       superseded by the rule that configuration in /etc will always take
238       precedence over configuration in /usr.
239

OPTIONS

241       Mount files must include a [Mount] section, which carries information
242       about the file system mount points it supervises. A number of options
243       that may be used in this section are shared with other unit types.
244       These options are documented in systemd.exec(5) and systemd.kill(5).
245       The options specific to the [Mount] section of mount units are the
246       following:
247
248       What=
249           Takes an absolute path of a device node, file or other resource to
250           mount. See mount(8) for details. If this refers to a device node, a
251           dependency on the respective device unit is automatically created.
252           (See systemd.device(5) for more information.) This option is
253           mandatory. Note that the usual specifier expansion is applied to
254           this setting, literal percent characters should hence be written as
255           "%%".
256
257       Where=
258           Takes an absolute path of a directory for the mount point; in
259           particular, the destination cannot be a symbolic link. If the mount
260           point does not exist at the time of mounting, it is created. This
261           string must be reflected in the unit filename. (See above.) This
262           option is mandatory.
263
264       Type=
265           Takes a string for the file system type. See mount(8) for details.
266           This setting is optional.
267
268       Options=
269           Mount options to use when mounting. This takes a comma-separated
270           list of options. This setting is optional. Note that the usual
271           specifier expansion is applied to this setting, literal percent
272           characters should hence be written as "%%".
273
274       SloppyOptions=
275           Takes a boolean argument. If true, parsing of the options specified
276           in Options= is relaxed, and unknown mount options are tolerated.
277           This corresponds with mount(8)'s -s switch. Defaults to off.
278
279       LazyUnmount=
280           Takes a boolean argument. If true, detach the filesystem from the
281           filesystem hierarchy at time of the unmount operation, and clean up
282           all references to the filesystem as soon as they are not busy
283           anymore. This corresponds with umount(8)'s -l switch. Defaults to
284           off.
285
286       ForceUnmount=
287           Takes a boolean argument. If true, force an unmount (in case of an
288           unreachable NFS system). This corresponds with umount(8)'s -f
289           switch. Defaults to off.
290
291       DirectoryMode=
292           Directories of mount points (and any parent directories) are
293           automatically created if needed. This option specifies the file
294           system access mode used when creating these directories. Takes an
295           access mode in octal notation. Defaults to 0755.
296
297       TimeoutSec=
298           Configures the time to wait for the mount command to finish. If a
299           command does not exit within the configured time, the mount will be
300           considered failed and be shut down again. All commands still
301           running will be terminated forcibly via SIGTERM, and after another
302           delay of this time with SIGKILL. (See KillMode= in
303           systemd.kill(5).) Takes a unit-less value in seconds, or a time
304           span value such as "5min 20s". Pass 0 to disable the timeout logic.
305           The default value is set from the manager configuration file's
306           DefaultTimeoutStartSec= variable.
307
308       Check systemd.exec(5) and systemd.kill(5) for more settings.
309

SEE ALSO

311       systemd(1), systemctl(1), systemd.unit(5), systemd.exec(5),
312       systemd.kill(5), systemd.resource-control(5), systemd.service(5),
313       systemd.device(5), proc(5), mount(8), systemd-fstab-generator(8),
314       systemd.directives(7)
315

NOTES

317        1. API File Systems
318           https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
319
320
321
322systemd 239                                                   SYSTEMD.MOUNT(5)
Impressum