hi,
I got myself a small NAS and wanted my opensuse 12.3 to mount one of the filesystem as CIFS, I know this can be easily done in KDE’s Dolphin but that “mount” is not really available to other application, so I wanted it more like a real mount and thus tried the following steps:
1- using an fstab entry: //192.168.2.200/test /home/test/test cifs username=test,password=test
of course this did not work since networkmanager was not up yet and thus the server could not be found as systemd said with error -101
2- I added the _netdev option, in the hopes it would help but that made no difference at all
3- searching the web I finally found why we have a cifs daemon in opensuse, so removed the line from fstab and added it to /etc/samba/cifstab, new reboot but nope even the cifs daemon started to early, maybe this works okay if not using networkmanager, not sure, but with networkmanager it does not.
4- more searching led me from fuse options (did not really find a good one) to autofs which I did not really investigate since I at the same moment I found x-systemd.automount for systemd, this looked promising so back I went from cifstab to fstab and added x-systemd.automount as option: //192.168.2.200/test /home/test/test cifs x-systemd.automount,username=test,password=test
Now this sort of work, the networkfs was mounted once I reached the desktop but sadly whatever I tried it was always mounted as root:root on /home/akm/test, also umount was not really working as it got auto-mounted right away which made me wonder how shutdown would go…
5- so a few more searches I came across /etc/NetworkManager/dispatcher.d/, there I created a file called cifs, chmod 775 and placed in it: mount -t cifs //192.168.2.200/test /home/test/test -o username=test,password=test, rebooted and it works like a charm.
I am not sure this is the perfect way to do it, but from all the options I tried it seems to be the best one so far, hope it helps those looking for a similar solution or if you know a better one I gladly hear about it
-Xil