I recently switched to Manjaro after using Mint for the last couple of years. My fstab contains the same lines for mounting samba shares which worked just fine on Mint, but now fails about half the time on Manjaro. When it fails, I can run “sudo mount -a” after logging in, and it works just fine.
Looking at dmesg, it looks like the problem is that the network is not available when the mounts occur.
My computers are connected via ethernet, so there shouldn’t be any connectivity issues.
Success:
[ 7.095407] r8169 0000:04:00.0 enp4s0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 7.095425] IPv6: ADDRCONF(NETDEV_CHANGE): enp4s0: link becomes ready
...
[ 7.183167] CIFS: Attempting to mount //192.168.1.175/media
[ 7.183190] CIFS: Attempting to mount //192.168.1.170/homes
[ 7.183210] CIFS: Attempting to mount //192.168.1.170/media
[ 7.183245] CIFS: Attempting to mount //192.168.1.175/homes
[ 7.183515] CIFS: Attempting to mount //192.168.1.170/files
Failure:
[ 3.377637] CIFS: Attempting to mount //192.168.1.170/media
[ 3.377666] CIFS: VFS: Error connecting to socket. Aborting operation.
[ 3.377669] CIFS: VFS: cifs_mount failed w/return code = -101
[ 3.377775] CIFS: Attempting to mount //192.168.1.175/media
[ 3.377804] CIFS: VFS: Error connecting to socket. Aborting operation.
[ 3.377805] CIFS: VFS: cifs_mount failed w/return code = -101
[ 3.377837] CIFS: Attempting to mount //192.168.1.170/files
[ 3.377859] CIFS: VFS: Error connecting to socket. Aborting operation.
[ 3.377861] CIFS: VFS: cifs_mount failed w/return code = -101
[ 3.378032] CIFS: Attempting to mount //192.168.1.170/homes
[ 3.378048] CIFS: VFS: Error connecting to socket. Aborting operation.
[ 3.378050] CIFS: VFS: cifs_mount failed w/return code = -101
[ 3.378157] CIFS: Attempting to mount //192.168.1.175/homes
[ 3.378173] CIFS: VFS: Error connecting to socket. Aborting operation.
[ 3.378174] CIFS: VFS: cifs_mount failed w/return code = -101
...
[ 6.894855] r8169 0000:04:00.0 enp4s0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 6.894861] IPv6: ADDRCONF(NETDEV_CHANGE): enp4s0: link becomes ready
Try adding the nofail mount option.
I needed to add this for an internal drive a bit too slow to mount at startup, yet it is correctly mounted every time the session is open.
Thanks for all the tips. I created mount units as suggested by @linux-aarhus and @Mirdarthos, and it worked the first two times I restarted the system, but failed on the third. Looking at the boot log, the same thing happened as before.
[ 3.458132] CIFS: Attempting to mount //192.168.1.170/files
[ 3.458161] CIFS: VFS: Error connecting to socket. Aborting operation.
[ 3.458163] CIFS: VFS: cifs_mount failed w/return code = -101
[ 3.458229] CIFS: Attempting to mount //192.168.1.170/homes
[ 3.458253] CIFS: VFS: Error connecting to socket. Aborting operation.
[ 3.458254] CIFS: VFS: cifs_mount failed w/return code = -101
...
[ 7.374430] r8169 0000:04:00.0 enp4s0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 7.374437] IPv6: ADDRCONF(NETDEV_CHANGE): enp4s0: link becomes ready
The share is only mounted when you access the share path and it is done so completely transparent even if it is from the terminal
cd /mnt/samba/server1_homes
Your permission issue is most likely because the client filesystem’s permission on server1_homes is read-only. A samba share mountpoint does not inherit the shares permissions - so even if the user connecting has read-write on the share itself the write will fail if the local mountpoint is read-only.
You need to ensure your client’s mountpoint is read-write - at least by o but you could use g as well
Thanks for all the help. It looks like it’s working now.
Initially the mounts would fail just like previously, and I got these types of messages:
[ 2.065292] systemd[1]: local-fs.target: Found ordering cycle on mnt-samba-server1_homes.automount/start
[ 2.065295] systemd[1]: local-fs.target: Found dependency on network-online.target/start
[ 2.065296] systemd[1]: local-fs.target: Found dependency on NetworkManager-wait-online.service/start
[ 2.065297] systemd[1]: local-fs.target: Found dependency on NetworkManager.service/start
[ 2.065299] systemd[1]: local-fs.target: Found dependency on dbus.socket/start
[ 2.065300] systemd[1]: local-fs.target: Found dependency on sysinit.target/start
[ 2.065302] systemd[1]: local-fs.target: Found dependency on systemd-journal-catalog-update.service/start
[ 2.065303] systemd[1]: local-fs.target: Found dependency on local-fs.target/start
[ 2.065305] systemd[1]: local-fs.target: Job mnt-samba-server1_homes.automount/start deleted to break ordering cycle starting with local-fs.target/start
But after some searching, I found that adding DefaultDependencies=no to the unit files solved the problem.
Also, I had to add file_mode=0777 and dir_mode=0777 to the options in the mount units to get the correct permissions.
I will do some more testing before I mark this as solved.
It is probably related to this - which I now realize only is relevant if it is a local partition - I think it can be safely removed. I will check with my working units.
I confused myself - it is the ‘local-fs.target’ messages - I don’t recall those messages in my log - but I have heard about it before
I think this has something to do with the credentials file being in the user’s home.
The difference to my system is I have the credentials in the mount unit.
When you get messages like the ones you get - it is not errors - it is messages - reordering loading sequence due to dependencies - network must be up.
But you clearly have a problem somewhere - a problem I don’t have although I have two smb mounts.
I have not paid enough attention to the logs as my system always worked - but I checked I had a few messages - and I can see where it lies - modify to look like below - I have forgotten to update the topic - so your topic made me revisit the guide and update accordingly
I will comment whether this helps - when I have checked my system.
After reading comments on github and experimenting the _netdev option will force the unit into the right ordering cycle - no requires or after is needed when it is a _netdev.