systemd automount does not work when the mount point doesn't exist from Red Hat Enterprise Linux 7.5
Issue
- I have a line in
/etc/fstab
:
tmpfs /mnt/test tmpfs defaults,noauto,x-systemd.automount 0 0
/mnt/test
directory doesn't exist. It's expected that it's created automatically bysystemd
.- From
man systemd.automount
:
DirectoryMode=
Directories of automount points (and any parent directories) are automatically created if needed. This option specifies the
file system access mode used when creating these directories. Takes an access mode in octal notation. Defaults to 0755.
- This
manpage
indicates that the mount point should be created automatically when it doesn't exist, regardless of the existence ofDirectoryMode=
option. - I had the following error with
systemctl start mnt-test.automount
Path /mnt/test is already a mount point, refusing start for mnt-test.automount
- This worked until
Red Hat Enterprise Linux 7.4
Environment
Red Hat Enterprise Linux 7.5 and 7.6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.