You are not logged in.

#1 2014-04-19 21:11:15

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

automount cifs share via fstab after wls connection established

i am trying to stick with fstab to mount a cifs share, but my wls connection on 'laptop' boot isnt established yet, causing it to spit out a couple errors

...
Apr 19 13:40:43 osprey mount[268]: mount error(101): Network is unreachable
Apr 19 13:40:43 osprey mount[268]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Apr 19 13:40:43 osprey systemd[1]: mnt-redtail-Users.mount mount process exited, code=exited status=32
Apr 19 13:40:43 osprey mount[269]: mount error(101): Network is unreachable
Apr 19 13:40:43 osprey mount[269]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Apr 19 13:40:43 osprey systemd[1]: Failed to mount /mnt/redtail/Users.
Apr 19 13:40:43 osprey systemd[1]: Dependency failed for Remote File Systems.
Apr 19 13:40:43 osprey systemd[1]: Unit mnt-redtail-Users.mount entered failed state.
Apr 19 13:40:43 osprey systemd[1]: mnt-redtail-UserFiles.mount mount process exited, code=exited status=32
Apr 19 13:40:43 osprey systemd[1]: Failed to mount /mnt/redtail/UserFiles.
Apr 19 13:40:43 osprey systemd[1]: Unit mnt-redtail-UserFiles.mount entered failed state.
Apr 19 13:40:43 osprey systemd[1]: mnt-redtail-PublicArchive.mount mount process exited, code=exited status=32
Apr 19 13:40:43 osprey systemd[1]: Failed to mount /mnt/redtail/PublicArchive.
Apr 19 13:40:43 osprey systemd[1]: Unit mnt-redtail-PublicArchive.mount entered failed state.
Apr 19 13:40:43 osprey systemd[1]: Starting Trigger Flushing of Journal to Persistent Storage...
Apr 19 13:40:43 osprey mount[270]: mount error(101): Network is unreachable
Apr 19 13:40:43 osprey mount[270]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Apr 19 13:40:43 osprey mount[271]: mount error(101): Network is unreachable
Apr 19 13:40:43 osprey mount[271]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Apr 19 13:40:43 osprey systemd[1]: mnt-falcon-san.mount mount process exited, code=exited status=32
Apr 19 13:40:43 osprey systemd[1]: Failed to mount /mnt/falcon/san.
Apr 19 13:40:43 osprey systemd[1]: Unit mnt-falcon-san.mount entered failed state.
Apr 19 13:40:44 osprey systemd-journal[140]: Permanent journal is using 556.3M (max allowed 1.5G, trying to leave 2.3G free of 5.9G available
Apr 19 13:40:45 osprey systemd-journal[140]: Time spent on flushing to /var is 1.482306s for 928 entries.
Apr 19 13:40:44 osprey sshd[266]: Server listening on 0.0.0.0 port 22.
Apr 19 13:40:44 osprey dhclient[276]: isc-dhclient-4.3.0
Apr 19 13:40:44 osprey dhclient[320]: isc-dhclient-4.3.0
Apr 19 13:40:43 osprey systemd[1]: Started Trigger Flushing of Journal to Persistent Storage.
Apr 19 13:40:43 osprey systemd[1]: Starting Permit User Sessions...
Apr 19 13:40:44 osprey systemd[1]: Started Permit User Sessions.
Apr 19 13:40:44 osprey systemd[1]: Starting Getty on tty1...
Apr 19 13:40:44 osprey systemd[1]: Started Getty on tty1.
Apr 19 13:40:44 osprey systemd[1]: Starting Login Prompts.
Apr 19 13:40:44 osprey systemd[1]: Reached target Login Prompts.
Apr 19 13:40:44 osprey systemd[1]: Starting K Display Manager...
Apr 19 13:40:44 osprey systemd[1]: Started K Display Manager.
Apr 19 13:40:46 osprey systemd[1]: Started Automounts filesystems on demand.
Apr 19 13:40:46 osprey kernel: brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: false (implement)
Apr 19 13:40:46 osprey kernel: brcmsmac bcma0:0: brcms_ops_config: change power-save mode: false (implement)
Apr 19 13:40:48 osprey systemd[1]: Started Samba NetBIOS name server.
Apr 19 13:40:48 osprey systemd[1]: Starting Samba SMB/CIFS server...
Apr 19 13:40:50 osprey systemd[1]: Started Samba SMB/CIFS server.
Apr 19 13:40:48 osprey systemd[1]: Started Samba NetBIOS name server.
Apr 19 13:40:48 osprey systemd[1]: Starting Samba SMB/CIFS server...
Apr 19 13:40:50 osprey systemd[1]: Started Samba SMB/CIFS server.
Apr 19 13:40:50 osprey systemd[1]: Starting Multi-User System.
Apr 19 13:40:50 osprey systemd[1]: Reached target Multi-User System.
Apr 19 13:40:50 osprey systemd[1]: Starting Graphical Interface.
Apr 19 13:40:50 osprey systemd[1]: Reached target Graphical Interface.
Apr 19 13:40:50 osprey systemd[1]: Startup finished in 4.675s (kernel) + 19.497s (userspace) = 24.172s.
Apr 19 13:40:50 osprey smbd[342]: [2014/04/19 13:40:50.949111,  0] ../source3/lib/util_sock.c:423(open_socket_in)
Apr 19 13:40:51 osprey smbd[342]: open_socket_in(): socket() call failed: Address family not supported by protocol
Apr 19 13:40:51 osprey smbd[342]: [2014/04/19 13:40:51.009171,  0] ../source3/smbd/server.c:691(smbd_open_one_socket)
Apr 19 13:40:51 osprey smbd[342]: smbd_open_once_socket: open_socket_in: Address family not supported by protocol
Apr 19 13:40:51 osprey smbd[342]: [2014/04/19 13:40:51.011457,  0] ../source3/lib/util_sock.c:423(open_socket_in)
Apr 19 13:40:51 osprey smbd[342]: open_socket_in(): socket() call failed: Address family not supported by protocol
Apr 19 13:40:51 osprey smbd[342]: [2014/04/19 13:40:51.011632,  0] ../source3/smbd/server.c:691(smbd_open_one_socket)
Apr 19 13:40:51 osprey smbd[342]: smbd_open_once_socket: open_socket_in: Address family not supported by protocol
Apr 19 13:40:51 osprey dbus[261]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service'
Apr 19 13:40:51 osprey dbus[261]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service failed to load: No such file or 
Apr 19 13:40:51 osprey kernel: r8169 0000:03:00.0 eth0: link down
Apr 19 13:40:55 osprey wicd[257]: dhcpcd[361]: dhcpcd not running
Apr 19 13:40:55 osprey dhcpcd[361]: dhcpcd not running
Apr 19 13:40:55 osprey kernel: brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: false (implement)
Apr 19 13:40:55 osprey kernel: brcmsmac bcma0:0: brcms_ops_config: change power-save mode: false (implement)
Apr 19 13:40:55 osprey wicd[257]: Failed to connect to non-global ctrl_ifname: wlan0  error: No such file or directory
Apr 19 13:40:55 osprey wicd[257]: dhcpcd[367]: dhcpcd not running
Apr 19 13:40:55 osprey dhcpcd[367]: dhcpcd not running
Apr 19 13:40:55 osprey kernel: r8169 0000:03:00.0 eth0: link down
Apr 19 13:40:55 osprey wicd[257]: Failed to connect to non-global ctrl_ifname: eth0  error: No such file or directory
Apr 19 13:40:55 osprey wicd[257]: dhcpcd[375]: dhcpcd not running
Apr 19 13:40:55 osprey dhcpcd[375]: dhcpcd not running
Apr 19 13:40:55 osprey kernel: brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: false (implement)
Apr 19 13:40:55 osprey kernel: brcmsmac bcma0:0: brcms_ops_config: change power-save mode: false (implement)
Apr 19 13:40:55 osprey wicd[257]: Failed to connect to non-global ctrl_ifname: wlan0  error: No such file or directory
Apr 19 13:40:58 osprey wicd[257]: ioctl[SIOCSIWENCODEEXT]: Invalid argument
Apr 19 13:40:58 osprey wicd[257]: ioctl[SIOCSIWENCODEEXT]: Invalid argument
Apr 19 13:40:58 osprey systemd-journal[140]: Forwarding to syslog missed 103 messages.
Apr 19 13:40:59 osprey kernel: wlan0: authenticate with 00:22:75:9d:ad:01
Apr 19 13:40:59 osprey kernel: wlan0: send auth to 00:22:75:9d:ad:01 (try 1/3)
Apr 19 13:40:59 osprey kernel: wlan0: authenticated
Apr 19 13:40:59 osprey kernel: brcmsmac bcma0:0 wlan0: disabling HT as WMM/QoS is not supported by the AP
Apr 19 13:40:59 osprey kernel: brcmsmac bcma0:0 wlan0: disabling VHT as WMM/QoS is not supported by the AP
Apr 19 13:40:59 osprey kernel: wlan0: associate with 00:22:75:9d:ad:01 (try 1/3)
Apr 19 13:40:59 osprey kernel: wlan0: RX AssocResp from 00:22:75:9d:ad:01 (capab=0x431 status=0 aid=32)
Apr 19 13:40:59 osprey kernel: brcmsmac bcma0:0: brcmsmac: brcms_ops_bss_info_changed: associated
Apr 19 13:40:59 osprey kernel: brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: false (implement)
Apr 19 13:40:59 osprey kernel: wlan0: associated
Apr 19 13:40:59 osprey kdm[356]: :0[356]: pam_unix(kde-np:session): session opened for user wolfdogg by (uid=0)
Apr 19 13:40:59 osprey systemd[1]: Starting user-1000.slice.
Apr 19 13:40:59 osprey systemd[1]: Created slice user-1000.slice.
Apr 19 13:40:59 osprey systemd[1]: Cannot add dependency job for unit swat.socket, ignoring: Unit swat.socket failed to load: No such file or directory.
Apr 19 13:40:59 osprey systemd[1]: Starting User Manager for UID 1000...
Apr 19 13:40:59 osprey systemd[1]: Starting Session c1 of user wolfdogg.
Apr 19 13:40:59 osprey systemd-logind[260]: New session c1 of user wolfdogg.
Apr 19 13:40:59 osprey systemd[1]: Started Session c1 of user wolfdogg.
Apr 19 13:40:59 osprey systemd[404]: pam_unix(systemd-user:session): session opened for user wolfdogg by (uid=0)
Apr 19 13:40:59 osprey systemd[404]: Starting Paths.
Apr 19 13:40:59 osprey systemd[404]: Reached target Paths.
Apr 19 13:40:59 osprey systemd[404]: Starting Timers.
Apr 19 13:40:59 osprey systemd[404]: Reached target Timers.
Apr 19 13:40:59 osprey systemd[404]: Starting Sockets.
Apr 19 13:40:59 osprey systemd[404]: Reached target Sockets.
Apr 19 13:40:59 osprey systemd[404]: Starting Basic System.
Apr 19 13:40:59 osprey systemd[404]: Reached target Basic System.
Apr 19 13:40:59 osprey systemd[404]: Starting Default.
Apr 19 13:40:59 osprey systemd[404]: Reached target Default.
Apr 19 13:40:59 osprey systemd[404]: Startup finished in 89ms.
Apr 19 13:40:59 osprey systemd[1]: Started User Manager for UID 1000.
Apr 19 13:41:02 osprey kernel: brcmsmac bcma0:0: brcms_ops_bss_info_changed: arp filtering: 1 addresses (implement)
Apr 19 13:41:05 osprey systemd[1]: Cannot add dependency job for unit swat.socket, ignoring: Unit swat.socket failed to load: No such file or directory.
Apr 19 13:41:05 osprey systemd[1]: Starting Getty on tty2...
...

i have autofs installed but its temperamental at best, can NOT get it to work anymore even though i have reconfigured it many times.  when i do a

mount -a

after boot all is well, so i was wondering how i could delegate the mounting of cifs shares to systemd if possible, or set a delay the mounting.   

also, i was going to simply add 'mount -a' to a startup script, but im not sure where to put that anymore since systemd.  i was hoping i could add a systemd service for that custom command or something, then just be done with it..

Last edited by wolfdogg (2014-04-22 17:53:09)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#2 2014-04-19 21:30:30

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: automount cifs share via fstab after wls connection established

You have been around long enough to know the difference between code and quote tags: please fix your post.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-04-19 21:33:52

cris9288
Member
Registered: 2013-01-07
Posts: 348

Re: automount cifs share via fstab after wls connection established

why don't you post your fstab? I'm pretty sure there's a way to tell systemd that the filesystem is a network resource and too not mount it on boot, instead only on first access.

see here: https://wiki.archlinux.org/index.php/NF … th_systemd

The relevant parts are the noauto and x-systemd options. The rest is pertains to NFS shares, though you should be able to adopt it for Samba.

Offline

#4 2014-06-25 05:24:08

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: automount cifs share via fstab after wls connection established

i did get this solved, i used systemd, and have some entries in the automount.  each time i come back to this thread its not on the laptop where i was having the problem.  basically i needed to mount them with fstab and add the correct options.   i will post my fstab here and show how i fixed it.


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#5 2014-06-25 06:53:11

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: automount cifs share via fstab after wls connection established

Here is how I mount my cifs NAS shares in fstab. They are systemd automounts so will only mount when they are accessed, and being controlled by systemd, they are properly unmounted before the network goes down.

//LENOVO/Documents /mnt/lenovo/documents/ cifs rw,uid=1000,gid=100,noauto,sec=ntlm,credentials=/etc/conf.d/nas.cred,x-systemd.automount 0 0

Offline

#6 2014-06-25 17:31:32

stevenhoneyman
Member
From: England
Registered: 2014-05-25
Posts: 241

Re: automount cifs share via fstab after wls connection established

Mine are set to have the options including "noauto,users" in fstab, and then I have a startup script that waits for a network connection (and gives up after a minute or so) which mounts them if it sees them

Offline

#7 2014-06-25 21:40:27

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: automount cifs share via fstab after wls connection established

stevenhoneyman wrote:

Mine are set to have the options including "noauto,users" in fstab, and then I have a startup script that waits for a network connection (and gives up after a minute or so) which mounts them if it sees them

The reason I leave mine to systemd automounts is on shutdown, they are unmounted cleanly.

I used to use ifup/ifdown scripts based on network state, but the shares were never unmounted cleamly as the network always was brought down by systemd before the ifdown script could be run. This also resulted in a 30 second timeout in shutdown as the shares were trying to be unmounted, but unable to be as the newtork was down.

With systemd handling the entire mount/unmount process, they are always properly unmounted before the network goes down.

Cheers.

Offline

#8 2014-06-25 21:47:48

stevenhoneyman
Member
From: England
Registered: 2014-05-25
Posts: 241

Re: automount cifs share via fstab after wls connection established

Padfoot wrote:
stevenhoneyman wrote:

Mine are set to have the options including "noauto,users" in fstab, and then I have a startup script that waits for a network connection (and gives up after a minute or so) which mounts them if it sees them

The reason I leave mine to systemd automounts is on shutdown, they are unmounted cleanly.

I used to use ifup/ifdown scripts based on network state, but the shares were never unmounted cleamly as the network always was brought down by systemd before the ifdown script could be run. This also resulted in a 30 second timeout in shutdown as the shares were trying to be unmounted, but unable to be as the newtork was down.

With systemd handling the entire mount/unmount process, they are always properly unmounted before the network goes down.

Cheers.

Interesting! I experienced that same thing years ago on Debian with initscripts, but much as I hate to say it, systemd seems to have cured that problem for me - I don't unmount them, and shutdown hasn't failed/lagged yet.

I wonder if wireless and wired are disconnected at different times (that's one difference I can see - I'm using a wired connection)

Offline

#9 2014-06-30 06:14:38

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: automount cifs share via fstab after wls connection established

Ths is the way i have it set up now.  its very reliable.

//192.168.1.10/san              /mnt/falcon/san            cifs credentials=/etc/conf.d/x.cred,noauto,nofail,x-systemd.automount,x-systemd.device-timeout=90 0       0

Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

Board footer

Powered by FluxBB