Share not always available after boot

Hi,

for a long time now I’ve successfully used /etc/fstab to mount a share on boot:

//192.168.0.1/MY.NAS/share /mnt/nas cifs user,username=xxx,password=xxx,uid=root,gid=root 0 0

(I guess, I’m not 100% sure) since the last OSMC update (May), the mount on boot is not always successful. It’s a 60:40 chance that it works.

If it fails I can see this in dmesg:

[    8.973883] CIFS VFS: Error connecting to socket. Aborting operation.
[    8.974058] CIFS VFS: cifs_mount failed w/return code = -101

If I login and issue mount -a the share is correctly mounted.

Could that be timing problem on boot or something? Any suggestions to fix or further debug the problem are appreciated.

Casper

Use systemd automount or search for wait for network

Sam

1 Like

If you want it to mount at boot time, there’s no need for the user option (and anyway, you can always use sudo).

To expand on what Sam said, you should add this to the mount options noauto,x-systemd.automount so it would look like:

//192.168.0.1/MY.NAS/share /mnt/nas cifs noauto,x-systemd.automount,username=xxx,password=xxx,uid=root,gid=root 0 0

Thank you both! I will give that a try.

Just out of interest: are you aware of a change that could caused that? I hate it not to know, when something stopped working, that worked flawless before :yum:

Since you say that there’s a 60:40 chance of it working, there’s a fair chance it’s a timing issue.

No change, but you should be waiting for network in fstab if you want things to work properly. Otherwise mounting is not guaranteed.

That worked. Thanks!