13

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?

1
  • I'm not a Ubunut user but I think Ubuntu moved to systemd. the x-systemd.automount should work with the latest version.
    – Philippe
    Jun 23, 2015 at 17:16

2 Answers 2

25

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.

1
  • 1
    This works great. You can also add x-systemd.device-timeout=10 to your fstab line for a timeout limit. May 21, 2018 at 13:36
5

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

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .