x-systemd.automount & CIFS shares in fstab
Solution 1
Ubuntu doesn't use systemd, so x-systemd.automount won't work. I guess it is just interpreted as an invalid mount option.
If you want to have your CIFS share mounted on-demand have a look at this: http://wiki.ubuntuusers.de/Autofs
Solution 2
systemd was introduced in ubuntu 15.04.
After adding x-systemd.automount
to an fstab
line, you need to run:
sudo systemctl daemon-reload
and then one, or both, of the following:
sudo systemctl restart remote-fs.target
sudo systemctl restart local-fs.target
only then will the automount become active.
Related videos on Youtube
John Manak
Updated on September 18, 2022Comments
-
John Manak over 1 year
In my
/etc/fstab
, I have set up a few CIFS shares to be mounted, using the template shown below://192.168.0.1/volume /mnt/mountpoint/ cifs auto,_netdev,x-systemd.automount,uid=1000,cache=none,user=XXX,password=XXX,workgroup=WORKGROUP 0 0
I copied the same lines to my colleague's computer (we are both running Ubuntu 12.04 LTS); however, the shares wouldn't mount on his computer until I removed the
x-systemd.automount
option.As I'd like to understand the problem, could you please let me know what might have caused it?
-
Admin almost 9 yearsI'm not a Ubunut user but I think Ubuntu moved to systemd. the x-systemd.automount should work with the latest version.
-
-
razor7 about 8 yearsHi!, you should update your answer because Ubuntu 16.04 already supports systemd, and therefore thet option x-systemd.automount will work. manpages.ubuntu.com/manpages/xenial/man5/systemd.mount.5.html
-
Stuart K. Smith almost 6 yearsThis works great. You can also add
x-systemd.device-timeout=10
to your fstab line for a timeout limit.