You are not logged in.
Pages: 1
Topic closed
Hi guys, I successfully got Samba working on my home serv last night but for some reason I cannot seem to automount the share at boot time (native systemd)
/etc/fstab
# kphmsrv /mnt/Files Samba
//kphmsrv/Files /mnt/Files cifs users,username=kaipee,password={mypassword},workgroup=WORKGROUP,ip=192.168.0.10 0 0
errors.log
Sep 30 14:03:02 zoostorm-arch kernel: [ 8.721292] CIFS VFS: Error connecting to socket. Aborting operation
Sep 30 14:03:02 zoostorm-arch kernel: [ 8.721956] CIFS VFS: cifs_mount failed w/return code = -101
I thought systemd wouldn't attempt mounting until network was up?
I have removed both noauto (as I did want to automount at boot) and noatime (as I read that it causes issues when mounting at boot)
Linux zoostorm-arch 3.5.4-1-ARCH #1 SMP PREEMPT Sat Sep 15 08:12:04 CEST 2012 x86_64 GNU/Linux
Last edited by kaipee (2012-10-02 18:04:25)
Offline
Once logged in, however, I can successfully mount the share with
mount /mnt/Files
with any user
Offline
My look something like this:
//192.168.0.2/big_drive /media/ArchSamba cifs auto,owner,rw,username=magnus,password=*****blabla 0 0
Offline
OK so I think I have narrowed it down to the network not being connected.
My current /etc/fstab
# kphmsrv /mnt/Files Samba
//kphmsrv/Files /mnt/Files cifs _netdev,users,username=kaipee,password={mypassword},workgroup=WORKGROUP,ip=192.168.0.10 0 0
Booting shows failed for a dependency.
Error log shows:
Sep 30 15:22:28 zoostorm-arch kernel: [ 1023.268131] CIFS VFS: default security mechanism requested. The default security mechanism will be upgraded from ntlm to ntlmv2 in kernel release 3.3
Sep 30 16:24:39 zoostorm-arch kernel: [ 10.125967] CIFS VFS: Error connecting to socket. Aborting operation
Sep 30 16:24:39 zoostorm-arch kernel: [ 10.126602] CIFS VFS: cifs_mount failed w/return code = -101
Upon login I can mount the share, however if I disable my wireless connection and try to mount I get:
[kaipee@zoostorm-arch ~]$ mount /mnt/Files
mount error(101): Network is unreachable
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
...and the same error occurs:
Sep 30 15:33:04 zoostorm-arch kernel: [ 515.431106] CIFS VFS: default security mechanism requested. The default security mechanism will be upgraded from ntlm to ntlmv2 in kernel release 3.3
Sep 30 15:33:33 zoostorm-arch kernel: [ 544.010324] CIFS VFS: Error connecting to socket. Aborting operation
Sep 30 15:33:33 zoostorm-arch kernel: [ 544.010406] CIFS VFS: cifs_mount failed w/return code = -10
So it does indeed look like it won't mount at boot because of no network connection - however I have included the _netdev option and I am using systemd which is supposed to not attempt mounting until network is available ??
Last edited by kaipee (2012-09-30 14:42:46)
Offline
I just don't get what is happening here. I have updated my /etc/fstab to read:
//192.168.0.10/Files /mnt/Files cifs x-systemd.device-timeout=60s,users,username=kaipee,password={mypassword},workgroup=WORKGROUP,ip=192.168.0.10 0 0
...forcing systemd to wait for at least 60 seconds to mount the share. My machine boots and logs in with a working connection in about 15 seconds after initial loading.
https://lh4.googleusercontent.com/-DOTi … 0409_6.jpg
Yet it still complains that the network is not available and is clearly ignoring the options about timeout and _netdev ??!
[kaipee@zoostorm-arch ~]$ systemctl status mnt-Files.mount
mnt-Files.mount - /mnt/Files
Loaded: loaded (/etc/fstab)
Active: failed (Result: exit-code) since Sun, 30 Sep 2012 17:06:44 +0100
Where: /mnt/Files
What: //192.168.0.10/Files
Process: 385 ExecMount=/bin/mount //192.168.0.10/Files /mnt/Files -t cifs -o x-systemd.device-timeout=60s,users,username=kaipee,password=P@ss,workgroup=WORKGROUP,ip=192.168.0.10 (code=exited, status=32)
CGroup: name=systemd:/system/mnt-Files.mount
Sep 30 17:06:44 zoostorm-arch mount[385]: mount error(101): Network is unreachable
Sep 30 17:06:44 zoostorm-arch mount[385]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Sep 30 17:06:44 zoostorm-arch systemd[1]: Failed to mount /mnt/Files.
Moderator edit: The image is too big. Reduced to url.
Last edited by bernarcher (2012-09-30 15:29:43)
Offline
_netdev only works if you have proper activation of network.target. How are you establishing a network connection?
Alternatively, just use an automounter on the share and let it be mounted on first access -- add noauto,x-systemd.automount to the options.
Offline
Hi falconindy,
I'm connecting to a wireless network with WPA2 (WUSBN v2) using the NetworkManager service. How do I configure/check this network.target?
Offline
How does the automount unit work?
I have a few applications and services that use the samba share/mount so kind of want it always mounted.
Offline
I was leaning more towards are there any benefits of this over mounting at boot?
Is it configured for every user automatically? Is it mounted by user or root?
Why is an automount unit better than automatically mounting during boot?
Offline
I was leaning more towards are there any benefits of this over mounting at boot?
Sure. You don't have to worry about when the network comes up.
Is it configured for every user automatically? Is it mounted by user or root?
It's mounted by root according to the options in fstab. It's exactly the same as if you were insisting it mount on boot.
Why is an automount unit better than automatically mounting during boot?
Boot won't explicitly hang waiting for this to mount -- only for the automount to be initialized on the mountpoint.
Offline
But I kind of want boot to hang - at least until the network comes up and continues to mount the share
Offline
...does the automount launch a 'daemon' of sorts, running in the background and waiting for a working network connection before initializing the mount? Allowing the rest of the system to function normally, and mounting the share as soon as a valid connection is confirmed?
Offline
Offline
Working /etc/fstab entry:
//192.168.0.10/Files /mnt/Files cifs auto,x-systemd.automount,cache=none,rsize=130048,wsize=57344,users,username=kaipee,password={mypassword},workgroup=WORKGROUP,ip=192.168.0.10 0 0
Last edited by kaipee (2012-10-02 18:04:10)
Offline
I gotta admit I was dead set against the automount solution when I read the suggestion but it works beautifully. Hardly any lag at all on first time access and no hanging issues (so far). Thanks, falconindy.
EDIT: Spoke too soon. This thread is marked solved, so I won't bring up my issues here. Started a new thread instead. Apologies for the mess.
Last edited by madchine (2012-10-03 22:33:59)
Offline
@falconindy can you give me a hand with the automount option? https://bbs.archlinux.org/viewtopic.php?id=150030
Offline
Just passing by to mention that the entry that turned out to work for @kaipee contains auto, non noauto as @falconindy suggested. And indeed, this works for me too.
1 made 2 edits to my own existing lines:
remove _netdev
replace noauto by auto
Doesn't make too much sense to me, but it works
Offline
ninovanhooff,
Welcome to the Arch Linux Forums. You opened with a fairly good post that is on topic, but do keep an eye on the age of the threads; this one is five years old.
https://wiki.archlinux.org/index.php/Co … bumping.22
Using this opportunity to close this old thread.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Pages: 1
Topic closed