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:
// /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”
// /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


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.


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 Learn

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


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

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:


1 Like

Hi bmillham,

I just upgraded to Kodi 19.3 Matrix and your tutorial is still as relevant as ever for me, thanks!

I’m streaming from an older Synology NAS with an up to date DSM 6.2 and SMB shares. It replies when I ping but strangely I don’t see it when I run:

osmc@osmc:~$ showmount -e 192.168.x.xx
clnt_create: RPC: Unable to receive

…and it also doesn’t work when using vers=3.0 but switching to vers=1.0 fixed it :grin:

Is for NFS shares not SMB shares

1 Like