1SYSTEMD.AUTOMOUNT(5) systemd.automount SYSTEMD.AUTOMOUNT(5)
2
3
4
6 systemd.automount - Automount unit configuration
7
9 automount.automount
10
12 A unit configuration file whose name ends in ".automount" encodes
13 information about a file system automount point controlled and
14 supervised by systemd. Automount units may be used to implement
15 on-demand mounting as well as parallelized mounting of file systems.
16
17 This man page lists the configuration options specific to this unit
18 type. See systemd.unit(5) for the common options of all unit
19 configuration files. The common configuration items are configured in
20 the generic [Unit] and [Install] sections. The automount specific
21 configuration options are configured in the [Automount] section.
22
23 Automount units must be named after the automount directories they
24 control. Example: the automount point /home/lennart must be configured
25 in a unit file home-lennart.automount. For details about the escaping
26 logic used to convert a file system path to a unit name see
27 systemd.unit(5). Note that automount units cannot be templated, nor is
28 it possible to add multiple names to an automount unit by creating
29 additional symlinks to its unit file.
30
31 For each automount unit file a matching mount unit file (see
32 systemd.mount(5) for details) must exist which is activated when the
33 automount path is accessed. Example: if an automount unit
34 home-lennart.automount is active and the user accesses /home/lennart
35 the mount unit home-lennart.mount will be activated.
36
37 Note that automount units are separate from the mount itself, so you
38 should not set After= or Requires= for mount dependencies here. For
39 example, you should not set After=network-online.target or similar on
40 network filesystems. Doing so may result in an ordering cycle.
41
42 Note that automount support on Linux is privileged, automount units are
43 hence only available in the system service manager (and root's user
44 service manager), but not in unprivileged users' service managers.
45
46 Note that automount units should not be nested. (The establishment of
47 the inner automount point would unconditionally pin the outer mount
48 point, defeating its purpose.)
49
51 Implicit Dependencies
52 The following dependencies are implicitly added:
53
54 • If an automount unit is beneath another mount unit in the file
55 system hierarchy, a requirement and ordering dependencies are
56 created to the on the unit higher in the hierarchy.
57
58 • An implicit Before= dependency is created between an automount unit
59 and the mount unit it activates.
60
61 Default Dependencies
62 The following dependencies are added unless DefaultDependencies=no is
63 set:
64
65 • Automount units acquire automatic Before= and Conflicts= on
66 umount.target in order to be stopped during shutdown.
67
68 • Automount units automatically gain an After= dependency on
69 local-fs-pre.target, and a Before= dependency on local-fs.target.
70
72 Automount units may either be configured via unit files, or via
73 /etc/fstab (see fstab(5) for details).
74
75 For details how systemd parses /etc/fstab see systemd.mount(5).
76
77 If an automount point is configured in both /etc/fstab and a unit file,
78 the configuration in the latter takes precedence.
79
81 Automount unit files may include [Unit] and [Install] sections, which
82 are described in systemd.unit(5).
83
84 Automount unit files must include an [Automount] section, which carries
85 information about the file system automount points it supervises. The
86 options specific to the [Automount] section of automount units are the
87 following:
88
89 Where=
90 Takes an absolute path of a directory of the automount point. If
91 the automount point does not exist at time that the automount point
92 is installed, it is created. This string must be reflected in the
93 unit filename. (See above.) This option is mandatory.
94
95 ExtraOptions=
96 Extra mount options to use when creating the autofs mountpoint.
97 This takes a comma-separated list of options. This setting is
98 optional. Note that the usual specifier expansion is applied to
99 this setting, literal percent characters should hence be written as
100 "%%".
101
102 DirectoryMode=
103 Directories of automount points (and any parent directories) are
104 automatically created if needed. This option specifies the file
105 system access mode used when creating these directories. Takes an
106 access mode in octal notation. Defaults to 0755.
107
108 TimeoutIdleSec=
109 Configures an idle timeout. Once the mount has been idle for the
110 specified time, systemd will attempt to unmount. Takes a unit-less
111 value in seconds, or a time span value such as "5min 20s". Pass 0
112 to disable the timeout logic. The timeout is disabled by default.
113
114 Check systemd.unit(5), systemd.exec(5), and systemd.kill(5) for more
115 settings.
116
118 systemd(1), systemctl(1), systemd.unit(5), systemd.mount(5), mount(8),
119 automount(8), systemd.directives(7)
120
121
122
123systemd 251 SYSTEMD.AUTOMOUNT(5)