x-systemd.automount & CIFS shares in fstab
Matthew Harrington
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 0I 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?
12 Answers
systemd was introduced in ubuntu 15.04.
After adding x-systemd.automount to an fstab line, you need to run:
sudo systemctl daemon-reloadand then one, or both, of the following:
sudo systemctl restart remote-fs.target
sudo systemctl restart local-fs.targetonly then will the automount become active.
1Ubuntu 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:
1