LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-07-2018, 06:46 AM   #1
demomixas
LQ Newbie
 
Registered: Sep 2018
Posts: 2

Rep: Reputation: Disabled
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 ^^
 
Old 09-07-2018, 07:22 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by demomixas View Post
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?
 
Old 09-07-2018, 08:02 AM   #3
demomixas
LQ Newbie
 
Registered: Sep 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
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.

Last edited by demomixas; 09-07-2018 at 08:03 AM.
 
Old 09-07-2018, 08:18 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to use autofs to mount a NFS share apimente.br Mageia 3 06-30-2017 07:37 AM
Running dual boot Windows and Ubuntu 14.04 LTS, want to repartition to keep Ubuntu and replace Windows with CentOS new_eyes_open Linux - Newbie 2 05-10-2016 12:32 PM
Unable to mount Windows share in Ubuntu m0by Linux - Networking 4 08-14-2013 11:55 AM
Using Autofs to mount CIFS share and busy files? wernox Linux - Server 5 04-30-2010 04:39 AM
mount windows share export to samba share -> improve network performance tuning newuser77 Linux - Server 1 07-23-2008 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 05:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration