You are not logged in.

#1 2018-06-20 00:15:28

Noki
Member
Registered: 2018-06-08
Posts: 98

[SOLVED] CIFS Mount on Boot issue

Hi all, reposting after trying to use an old thread (and getting told off). I am trying to use the method described here to mount a CIFS share on boot. Previously in Ubuntu I simply did this in /etc/fstab but it's not working for me in Arch.

I've built everything described in the thread and tried a few combinations of 'options' but it keeps failing with:

kernel: CIFS VFS: Error connecting to socket. Aborting operation.
kernel: CIFS VFS: cifs_mount failed w/return code = -115

I can't find any reference to error code -115

Mounting it using this command works: sudo mount -vvv -t cifs -o credentials=/home/noki/.smbcredentials -o uid=1000 -o gid=1000 -o iocharset=utf8 -o sec=ntlm -o vers=1.0 //192.168.0.11/media /home/noki/Kaboom

This is my version of the mount systemd file named correctly as described in the link below.

[Unit]
Description = Kaboom Mount

[Mount]
What = //192.168.16.11/media
Where = /home/noki/Kaboom
Type = cifs
Options = uid=1000,gid=1000,credentials=/home/noki/.smbcredentials,iocharset=utf8,nofail,vers=1.0,dir_mode=0777

[Install]
WantedBy = multi-user.target

Bit stuck for what to try next if anyone could give me some pointers?

Useful info on using systemd to mount correctly

Last edited by Noki (2018-06-20 11:54:21)

Offline

#2 2018-06-20 00:22:40

loqs
Member
Registered: 2014-03-06
Posts: 17,363

Re: [SOLVED] CIFS Mount on Boot issue

Why are you not following Samba#Automatic_mounting?

Offline

#3 2018-06-20 10:23:45

Noki
Member
Registered: 2018-06-08
Posts: 98

Re: [SOLVED] CIFS Mount on Boot issue

Sorry I hadn't found that during all my searches for this issue.

I didn't realise I needed to do so many things when adding a line to fstab was enough in Ubuntu and the fact that after logging into Arch I can just run "sudo mount -a" and it mounts the share just fine (within only the fstab entry).

I'm running through these instructions now but still not having much luck. I don't get why it would need all of this additional SMB config when it works just fine mount after boot. I guess these additional SMB configurations are just required to get things working during boot. including having another file with my login details in. Seems odd to me without fully understanding how it works.

Now I have more to go on I will keep trying, but right now I've broken it even more! Hopefully won't take long, thanks for pointing me in the right direction.

Last edited by Noki (2018-06-20 10:25:49)

Offline

#4 2018-06-20 10:50:24

Noki
Member
Registered: 2018-06-08
Posts: 98

Re: [SOLVED] CIFS Mount on Boot issue

Nope, really not getting this at all. I've done all the things it says. Still getting errors on boot that it cannot mount it and now I have to argue with it to get it to mount after booting.

The normal mount command works, the fstab entry contains all the things that the mount command does, I've started and enabled the required daemons (NetworkManager-wait-online.service and my mount file).

Output of "systemctl status home-noki-Kaboom.mount"

● home-noki-Kaboom.mount - Kaboom Mount
   Loaded: loaded (/etc/systemd/system/home-noki-Kaboom.mount; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2018-06-20 11:45:02 BST; 48s ago
    Where: /home/noki/Kaboom
     What: //192.168.16.11/media
  Process: 557 ExecMount=/usr/bin/mount //192.168.16.11/media /home/noki/Kaboom -t cifs -o uid=noki,gid=users,credentials=/home/noki/.smbcredentials,iocharset=utf8,rw,x-systemd.automount >

Jun 20 11:45:02 GRANDSLAM systemd[1]: Mounting Kaboom Mount...
Jun 20 11:45:02 GRANDSLAM systemd[1]: home-noki-Kaboom.mount: Mount process exited, code=exited status=32
Jun 20 11:45:02 GRANDSLAM mount[557]: mount error(101): Network is unreachable
Jun 20 11:45:02 GRANDSLAM mount[557]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Jun 20 11:45:02 GRANDSLAM systemd[1]: home-noki-Kaboom.mount: Failed with result 'exit-code'.
Jun 20 11:45:02 GRANDSLAM systemd[1]: Failed to mount Kaboom Mount.

Now on boot I have to unmount the folder then run "sudo mount -a" and it gets magically fixed, no errors.

My fstab entry looks like this:

#KABOOM Media Mount
//192.168.0.11/media    /home/noki/Kaboom  cifs    credentials=/home/noki/.smbcredentials,iocharset=utf8,dir_mode=0777,gid=1000,uid=1000,sec=ntlm,vers=1.0,x-systemd.automount,comment=systemd.automount  0   0

And my systemd mount file looks like:

[Unit]
Description=Mount Share at boot
Requires=systemd-networkd.service
After=network-online.target
Wants=network-online.target

[Mount]
What=//server/share
Where=/mnt/myshare
Options=credentials=/etc/samba/creds/myshare,iocharset=utf8,rw,x-systemd.automount
Type=cifs
TimeoutSec=30

[Install]
WantedBy=multi-user.target

Stuck for what to do next, looking now for what the error code 32 is about.

Last edited by Noki (2018-06-20 10:56:21)

Offline

#5 2018-06-20 11:05:17

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,718

Re: [SOLVED] CIFS Mount on Boot issue

It's quite unclear what exactly you have right now and I suspect you now have multiple distinct configurations all trying to do the same thing which creates issues. First off - and I assume that's where most of the confusion comes from - the wiki points to multiple distinct and independent methods for accomplishing the same goal. Select and choose one of the subheadings of automatic mounting. As you want an fstab entry follow https://wiki.archlinux.org/index.php/Sa … ount_entry Remove everything else you've done.

Did you enable the appropriate wait-online service mentioned in the note at the start of the Automatic Mounting section?

Last edited by V1del (2018-06-20 11:12:53)

Online

#6 2018-06-20 11:11:34

Noki
Member
Registered: 2018-06-08
Posts: 98

Re: [SOLVED] CIFS Mount on Boot issue

Yeah I just clocked that, in a more awake state this morning I can see that this reads as separate methods. I am trying to dig out the second method now. Not having much luck.

Offline

#7 2018-06-20 11:29:32

Noki
Member
Registered: 2018-06-08
Posts: 98

Re: [SOLVED] CIFS Mount on Boot issue

At this point i have pulled out the samba stuff from the second method. So I should have stopped that from interfering. However I don't know how to reverse "smbtree -U remote_user" this command. All other links and files made in that section are now gone.

This should now be a list of everything done and enabled:

Step 1

sudo systemctl status NetworkManager-wait-online.service
● NetworkManager-wait-online.service - Network Manager Wait Online
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager-wait-online.service; enabled; vendor preset: disabled)
   Active: active (exited) since Wed 2018-06-20 12:01:25 BST; 20min ago
     Docs: man:nm-online(1)
 Main PID: 540 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   Memory: 0B
   CGroup: /system.slice/NetworkManager-wait-online.service

Jun 20 12:01:19 GRANDSLAM systemd[1]: Starting Network Manager Wait Online...
Jun 20 12:01:25 GRANDSLAM systemd[1]: Started Network Manager Wait Online.

Step 2
My FSTAB entry is shown in a previous post, I am happy that is set currently since "sudo mount -a" works after I login.

Step 3
My mount file named "/etc/systemd/system/home-noki-Kaboom.mount" is set thusly:

[Unit]
Description = Kaboom Mount
Requires=systemd-networkd.service
After=network-online.target
Wants=network-online.target

[Mount]
What = //192.168.16.11/media
Where = /home/noki/Kaboom
Type = cifs
Options = uid=noki,gid=users,credentials=/etc/samba/creds/smbcreds,iocharset=utf8,rw,x-systemd.automount
TimeoutSec=15

[Install]
WantedBy = multi-user.target

Step 4
And has been enabled with "sudo systemctl enable home-noki-Kaboom.mount".

on boot it fails and this is what I see when i check the status of the mount:

sudo systemctl status home-noki-Kaboom.mount
● home-noki-Kaboom.mount - Kaboom Mount
   Loaded: loaded (/etc/systemd/system/home-noki-Kaboom.mount; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2018-06-20 12:26:48 BST; 5s ago
    Where: /home/noki/Kaboom
     What: //192.168.16.11/media
  Process: 3463 ExecMount=/usr/bin/mount //192.168.16.11/media /home/noki/Kaboom -t cifs -o uid=noki,gid=users,credentials=/etc/samba/creds/smbcreds,iocharset=utf8,rw,x-systemd.automount >

Jun 20 12:26:38 GRANDSLAM systemd[1]: home-noki-Kaboom.mount: Mount process exited, code=exited status=32
Jun 20 12:26:38 GRANDSLAM systemd[1]: home-noki-Kaboom.mount: Failed with result 'exit-code'.
Jun 20 12:26:38 GRANDSLAM systemd[1]: Failed to mount Kaboom Mount.
Jun 20 12:26:38 GRANDSLAM systemd[1]: Mounting Kaboom Mount...
Jun 20 12:26:48 GRANDSLAM mount[3463]: mount error(115): Operation now in progress
Jun 20 12:26:48 GRANDSLAM mount[3463]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Jun 20 12:26:48 GRANDSLAM systemd[1]: home-noki-Kaboom.mount: Mount process exited, code=exited status=32
Jun 20 12:26:48 GRANDSLAM systemd[1]: home-noki-Kaboom.mount: Failed with result 'exit-code'.
Jun 20 12:26:48 GRANDSLAM systemd[1]: Failed to mount Kaboom Mount.

As far as I can tell these are the 4 steps required steps for the method I am using.

Last edited by Noki (2018-06-20 11:30:58)

Offline

#8 2018-06-20 11:39:44

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,718

Re: [SOLVED] CIFS Mount on Boot issue

As you still have an fstab entry that should be the one to handle the mount, disable the service. If the fstab entry works correctly, you should, without explicitly calling mount -a simply be able to cd into the mount point directory (that's what x-systemd.automount is for)

Maybe also post

systemctl list-units --type=mount
systemctl list-unit-files --type=mount

Last edited by V1del (2018-06-20 11:44:49)

Online

#9 2018-06-20 11:54:04

Noki
Member
Registered: 2018-06-08
Posts: 98

Re: [SOLVED] CIFS Mount on Boot issue

Now I feel dumb. I removed the second steps so now I just have the NWM service and the fstab entry.

That'll teach me to google a problem before reading the wiki (I mean it won't, but I can pretend I've learned something).

Thanks once again!

Offline

Board footer

Powered by FluxBB