LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   autofs doesnt mount my Windows Share (Ubuntu 16.04 LTS) (https://www.linuxquestions.org/questions/ubuntu-63/autofs-doesnt-mount-my-windows-share-ubuntu-16-04-lts-4175637954/)

demomixas 09-07-2018 06:46 AM

autofs doesnt mount my Windows Share (Ubuntu 16.04 LTS)
 
Hello,

I'm trying to mount a windows share folder from a Win10 PC in my network to a directory in my linux server.

If I do

Code:

mount -t cifs -o username=guest,password=guest,vers=3.0 //192.168.1.107/ulark mnt/ulark
it mounts perfectly, but after the server reboot it doesnt mount because the device first tried to mount, then connects to network.

So i tried autofs

My auto.master:
Code:

#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc  /etc/auto.misc
/mnt /etc/auto.cifs-shares
#
# NOTE: mounts done from a hosts map will be mounted with the
#      "nosuid" and "nodev" options unless the "suid" and "dev"
#      options are explicitly given.
#
#/net  -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master

my auto.cifs-shares that i created for the application:
Code:

ulark -fstype=cifs,rw,username=guest,password=guest,file_mode=0777,dir_mode=0777,vers=3.0 ://192.168.1.107/ulark
Any advise would help loads, I'm still a novice with ubuntu ^^

berndbausch 09-07-2018 07:22 AM

Quote:

Originally Posted by demomixas (Post 5900846)
Hello,

I'm trying to mount a windows share folder from a Win10 PC in my network to a directory in my linux server.

If I do

Code:

mount -t cifs -o username=guest,password=guest,vers=3.0 //192.168.1.107/ulark mnt/ulark
it mounts perfectly, but after the server reboot it doesnt mount because the device first tried to mount, then connects to network.

This problem should be handled by the _netdev option in /etc/fstab. It seems to exist in Ubuntu. It will defer mounting until networking is up, and is used to mount other network-based filesystems like NFS or filesystems that reside on iSCSI servers.

See for examples instructions at https://help.ubuntu.com/community/NFSv4Howto, in the NFSv4 Client paragraph.

Regarding your AutoFS problem, I don't have a solution, but if I were you I would be looking for AutoFS log files in Ubuntu. Perhaps in the systemd journal?

demomixas 09-07-2018 08:02 AM

Forgot to mention, that previously i tried _netdev.
My fstab mounting line:

Code:

//192.168.1.107/ulark /mnt/ulark cifs _netdev,username=guest,password=guest,vers=3.0 0 0
After the reboot the problem was not solved. Perhaps i frazed the line incorrectly?

Google searches said that _netdev only works for nfs, not cifs. (I think they differ, no?)

Sorry if I miss out on something obvious, mostly started looking up mounting 4 days ago, so i don't fully understand the principle of how it works.

michaelk 09-07-2018 08:18 AM

I don't see anything obviously wrong with your configuration files. The share will not mount until you access the /mnt/ulark directory.

Did you start / enable autofs?

sudo service autofs start
sudo update-rc.d autofs defaults


All times are GMT -5. The time now is 03:09 AM.