Configuring fstab based Samba share mounts

A post was split to a new topic: Fstab credentials with Windows Live ID

I was troubleshooting another issue and this thread was linked. I like the idea of speeding up my samba shares but I’m wondering how it will affect my existing library?

I’ve been using a version of the same MySQL database on my Win7 PC with multiple RasPi3 clients connecting to it since XBMC11 on an atv1. If I remove my SMB shares from sources.xml and use this fstab method instead, is their any chance all my media will be reimported and duplicated and mess up my watch history etc?

Please forgive my ignorance.

You can use path substitution to handle the differences in paths.

1 Like

You really need to look into trakt.tv and it’s Kodi integration if watch history is important to you. Depending on the Kodi db alone is simply asking for disappointment.

@ActionA well it’s Kodi’s MySQL database stored on my media server which is backed up periodically. It’s been working well since early Crystalbuntu days. But I take your point, I’ll have a look at trakt.

@bmillham thanks, I will look into that.

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

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