Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Trouble automounting SMB-Share
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Clad in Sky
l33t
l33t


Joined: 04 May 2007
Posts: 851
Location: Germany

PostPosted: Sun Jan 06, 2019 5:39 pm    Post subject: [SOLVED]Trouble automounting SMB-Share Reply with quote

Hello,

I want to automatically mount a samba share at startup, but it does not work.
It does work fine, however, using "mount -a" or "mount /mount/point".

My fstab looks as follows, and probably there's something wrong in the options, but I can't find it after repeated alterations and reboots... still the share will not be mounted, but mounting it manually (as root - user mounts seem not to work due to some security issue and setuid) works.

Code:

//192.168.178.1/fritz.nas   /media/fritznas cifs vers=1.0,auto,_netdev,uid=1000,gid=1000,credentials=/home/user/.smbcredentials  0 0


Any help would be appreciated.

Solution: net.enp6s0 wasn't added to default runlevel but started as a dependency of probably ntpd - this prevented net from coming up earlier than netmount.
_________________
Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest


Last edited by Clad in Sky on Wed Jan 09, 2019 4:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13511

PostPosted: Sun Jan 06, 2019 10:02 pm    Post subject: Reply with quote

What message(s) does your init system print when it tries to mount the share? Is there anything relevant in dmesg?
Back to top
View user's profile Send private message
Clad in Sky
l33t
l33t


Joined: 04 May 2007
Posts: 851
Location: Germany

PostPosted: Mon Jan 07, 2019 5:28 am    Post subject: Reply with quote

Code:
NET: Registered protocol family 10
[   11.165676] IPv6: ADDRCONF(NETDEV_UP): enp6s0: link is not ready
[   11.165717] Segment Routing with IPv6
[   11.177362] Key type cifs.spnego registered
[   11.177365] Key type cifs.idmap registered
[   11.179417] CIFS VFS: Error connecting to socket. Aborting operation.
[   11.179419] CIFS VFS: cifs_mount failed w/return code = -101
[   11.215455] 8021q: adding VLAN 0 to HW filter on device bond0
[   11.215468] IPv6: ADDRCONF(NETDEV_UP): bond0: link is not ready
[   11.567311] resource sanity check: requesting [mem 0x000c0000-0x000fffff], which spans more than PCI Bus 0000:00 [mem 0x000c0000-0x000dffff window]
[   11.567406] caller _nv001094rm+0xe3/0x1d0 [nvidia] mapping multiple BARs
[   14.138551] igb 0000:06:00.0 enp6s0: igb: enp6s0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
[   14.138807] IPv6: ADDRCONF(NETDEV_CHANGE): enp6s0: link becomes ready

Seems like it's trying to mount before the network is ready... I thought this was what _netdev option was for.

[Moderator edit: added [code] tags to preserve output layout. -Hu]
_________________
Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3648
Location: Hamburg

PostPosted: Mon Jan 07, 2019 7:40 am    Post subject: Reply with quote

Clad in Sky wrote:
Seems like it's trying to mount before the network is ready... I thought this was what _netdev option was for.
Maybe IPv4 is up and that's what CIFS is looking for?
Back to top
View user's profile Send private message
Clad in Sky
l33t
l33t


Joined: 04 May 2007
Posts: 851
Location: Germany

PostPosted: Mon Jan 07, 2019 6:16 pm    Post subject: Reply with quote

Yeah, maybe. Any way around that? Could I make a script that mounts the share at the end of the boot process, even after my desktop comes up?
_________________
Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest
Back to top
View user's profile Send private message
nick_gentoo
n00b
n00b


Joined: 07 Jan 2019
Posts: 60

PostPosted: Tue Jan 08, 2019 7:41 pm    Post subject: Reply with quote

The mounting of the network shares is controlled by the netmount service, so make sure that it is started in the "default" runlevel with
Code:
rc-update show

The _netmount option in fstab is what is indicating that this is a network share and any mount should be attempted only after the network is up. From what I see, you have to define by yourself what it means that the network is up in /etc/conf.d/netmount, depending on how you configure networking in your case.
Back to top
View user's profile Send private message
Clad in Sky
l33t
l33t


Joined: 04 May 2007
Posts: 851
Location: Germany

PostPosted: Wed Jan 09, 2019 12:30 pm    Post subject: Reply with quote

Netmount is in the default runlevel, so that should be OK.
I changed /etc/conf.d/netmount to be:

Code:

#
# If you are using a dynamic network management tool like
# NetworkManager, dhcpcd in standalone mode, wicd, badvpn-ncd, etc, to
# manage the network interfaces with the routes to your netmounts, you
# should list that tool.
#
#rc_need="NetworkManager"
rc_need="dhcpcd"
#rc_need="wicd"
#


Alas, to no avail. Is there a way to move netmount to a later place in the startup process? I found some info but that seemed to be for CentOS only.
_________________
Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest
Back to top
View user's profile Send private message
nick_gentoo
n00b
n00b


Joined: 07 Jan 2019
Posts: 60

PostPosted: Wed Jan 09, 2019 2:06 pm    Post subject: Reply with quote

I think the value for rc_need should be the name of the service that starts the network. The more common names would be net.eth0 or net.lan0 or maybe net.enp6s0 in your case.
Could you list the full output of rc-update show? Do you have dhcpcd in the default runlevel?
Back to top
View user's profile Send private message
Clad in Sky
l33t
l33t


Joined: 04 May 2007
Posts: 851
Location: Germany

PostPosted: Wed Jan 09, 2019 3:06 pm    Post subject: Reply with quote

nick_gentoo wrote:
I think the value for rc_need should be the name of the service that starts the network. The more common names would be net.eth0 or net.lan0 or maybe net.enp6s0 in your case.
Could you list the full output of rc-update show? Do you have dhcpcd in the default runlevel?


I don't, for some reason:

Code:

               binfmt | boot                                   
             bootmisc | boot                                   
              cgroups |                                 sysinit
           consolekit |      default                           
               cronie |      default                           
                cupsd |      default                           
                 dbus |      default                           
                devfs |                                 sysinit
                dmesg |                                 sysinit
                 fsck | boot                                   
             hostname | boot                                   
              hwclock | boot                                   
              keymaps | boot                                   
            killprocs |                        shutdown       
    kmod-static-nodes |                                 sysinit
                local |      default nonetwork                 
           localmount | boot                                   
             loopback | boot                                   
              modules | boot                                   
             mount-ro |                        shutdown       
                 mtab | boot                                   
             netmount |      default                           
                 ntpd |      default                           
               procfs | boot                                   
                 root | boot                                   
         save-keymaps | boot                                   
    save-termencoding | boot                                   
            savecache |                        shutdown       
                 swap | boot                                   
               sysctl | boot                                   
                sysfs |                                 sysinit
             sysklogd |      default                           
         termencoding | boot                                   
                 udev |      default                    sysinit
         udev-trigger |                                 sysinit
              urandom | boot                                   
                  xdm |      default   


But in /conf.d/net I have:
Code:

config_enp6s0="dhcpcd"

So I guess that works, too.
I'll try with rc_need = net.enp6s0.

Thanks all for the input so far.
_________________
Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest
Back to top
View user's profile Send private message
nick_gentoo
n00b
n00b


Joined: 07 Jan 2019
Posts: 60

PostPosted: Wed Jan 09, 2019 3:58 pm    Post subject: Reply with quote

It looks like the networking is not explicitly started, but is maybe turned on by another service that depends on it (could be ntpd in this case).
Do you have a file named /etc/init.d/net.enp6s0?
Did you setup the network according to the Gentoo handbook?
Back to top
View user's profile Send private message
Clad in Sky
l33t
l33t


Joined: 04 May 2007
Posts: 851
Location: Germany

PostPosted: Wed Jan 09, 2019 4:36 pm    Post subject: Reply with quote

nick_gentoo wrote:
It looks like the networking is not explicitly started, but is maybe turned on by another service that depends on it (could be ntpd in this case).
Do you have a file named /etc/init.d/net.enp6s0?
Did you setup the network according to the Gentoo handbook?


I do have that file.
I hadn't added net.enp6s0 to the default runlevel for whatever reason (usually I adhere quite a lot to the handbook). I did now and it works.

Many thanks! :D :D

Solved now.
_________________
Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum