Configuring fstab based Samba share mounts

A post was split to a new topic: Mount different shares for different profiles using the fstab

I’m having trouble getting automount to work.
I tried:
//192.168.1.30/_movie-d /mnt/d cifs username=aaanmt,password=zzz,iocharset=utf8,sec=ntlm,vers=3.0 0 1

“mount -a” will manually mount the share.
Then finding this guide I updated fstab. Now mount -a doesn’t work (as intended), but I can do a “mount /mnt/d”
//192.168.1.30/_movie-d /mnt/d cifs x-systemd.automount,noauto,rw,iocharset=utf8,username=aaanmt,password=zzz,iocharset=utf8,sec=ntlm,vers=3.0,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0

Hi,

I would try removing the the noauto, if that doesn’t work; please open a new topic.

Thanks Tom.

Thanks Tom, that fixed it.

Thanks to all,
I’ve been using this for ages but recently it stopped working. It may have been when Samba on my file server updated to 4.7.1 or it may have been an OSMC update. To cut a long story short I was seeing a load of:

Dec 26 08:56:57 osmc kernel: Status code returned 0xc0000017 NT_STATUS_NO_MEMORY
Dec 26 08:56:57 osmc kernel: CIFS VFS: Send error in SessSetup = -121
Dec 26 08:56:57 osmc kernel: CIFS VFS: cifs_mount failed w/return code = -121

in the journal. The solution was to add “domain={my_domain_or_workgroup}” to the options. In my case is is “domain=home” as I’ve set my workgroup to “home” on my Samba server.

HTH

A post was split to a new topic: Unable to delete file with fstab mounted SMB shares

A post was split to a new topic: Help with FSTAB SMB mounts

I hadn’t twigged it only mounts when a program tries to access the FS. df doesn’t count!

I found just before the December update that sometimes playing files you would get an endless spinning circle/hour-glass. After it happened a few times I did some digging and found my windows 10 server would disconnect idle sessions after 15 minutes. And sometimes win10 would not respond to new requests correctly. After OSMC gives up 15 minutes later it starts a new connection which works.

I tried to extend the idle time but it still remained at 15 minutes. CIFS and SMB Timeouts in Windows | Microsoft Docs

I solved the timeout issue by installing “cron-app-osmc”. And told it to run “df” every 15 minutes, by adding to crontab:
*/15 * * * * df >/dev/null 2>&1

** update **
I found the following in /usr/share/kodi/system/advancedsettings.xml

30

So I changed it to 0 in /home/osmc/.kodi/userdata/advancedsettings.xml
Removed the contab few days ago and had no issues.

Hi, I would give the socket options SO_KEEPALIVE a try, see

https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#SOCKETOPTIONS

Means you modify /etc/samba/smb.conf on the OSMC device. But this could prevent some NAS from sleep.

OP says this is applicable to 17.x. How about 18.x? If so, can the OP be updated?

I think you may have misunderstood the OP. System mounts are applicable for any version of Kodi and will continue to be. What he was referring to is that Kodi’s built in networking improved a lot in v18 so the performance difference is likely to be less of an issue than it was with v17.

If your using Kodi networking and not experiencing any issues then there is no reason to change anything. If you need or want to get a bit more performance then system mounts may help with that.

I updated to state that fstab will still perform better with Kodi 18.x.

Hi bmillham

I just post to thank you very much for this tutorial, i had several stutter when playing 4K HEVC HDR high bitrate files from a SMB share (share from a windows 10 PC) on my Vero 4k+

I created fstab share and the problem is completely gone, so very useful tutorial :slight_smile:

Ciao

1 Like