SMB mount not preserved through a reboot

Hello there,
OSMC on Vero and RaspBMC on RPiB

Electricity went away, RPIB rebooted and has one of its filesystems properly exported with SMB.

Vero is attached to my TV and normally mounts the SMB share from the RPiB but now the movie list gives a “not found” for any title and if I go to the Videos->Files menu (Confluence skin) I see the “movies” source but get the “Could not connect to network share” which is not suprising since a check with df / mount shows the Vero has not mounted the RPiB export.

As the Movies directory is quite large and indexing is time consuming I would not want to take the shortcut of deleting the source and re-add it once again.

Where can I understand where OSMC stores the “Movies” path so that I can manually mount it in the right place ?

Thank you

PS Before someone asks, I cannot use NFS to share my movies directory because of a strange “bug” in the sharing protocol (not OSMC/RaspBMC related).


‘user’ home directory ./.kodi/userdata/

mediasources.xml lists “target” definitions for later browsing a source
sources.xml lists “sources” for media lookups

unfortunately the “source” is fully expanded and saved together with scraped media file. if you have DB stored on MySQL, you can run "update " on the relevant tables. if not, you can too, but you have to open DBfiles located at userdata/Database/ with sqlite3 command line tool.

easiest way to do that are “tricks” via host aliases, sym-linking and other.


Thanks a lot. Here is what /home/osmc/.kodi/userdata/sources.xml shows:

movies smb:// true tv smb://RPI-B/WD1TB/tv/ true

here is what I am doing in the shell:

root@osmc:/mnt# showmount --exports
Export list for
root@osmc:/mnt# cat /etc/fstab
/dev/mmcblk0p1 /boot vfat defaults,noatime 0 0
/dev/mmcblk0p2 / ext4 defaults,noatime 0 0

// /mnt/WD1TB cifs guest,uid=1000,gid=1000,iocharset=utf8,sec=ntlmv2 0 0
root@osmc:/mnt# mount -a
Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
root@osmc:/mnt# ls -la
totale 12
drwxr-xr-x 3 root root 4096 apr 27 19:52 .
drwxr-xr-x 23 root root 4096 mag 14 2014 …
drwxr-xr-x 2 root root 4096 apr 27 19:52 WD1TB

Am obviously doing something wrong but can’t understand. Any further help pls ?

Sorry for the confusion but further trials and errors showed I was getting the fstab line wrong.

Here’s the current one working

// /mnt/WD1TB cifs username=bob,password=XXXX,uid=1000,gid=1000,iocharset=utf8,sec=ntlmv2 0 0

Only problem I have now is that the mount does not happen automatically at reboot.

How to fix ?


showmount util is showing RPCInfo - NFS Exports. not cifs (samba/win sharing).

your fstab line should look: /mnt/WD1TB nfs defaults 0 0

but if you changed this, you will not manage the previous “smb://xxxxxxx” as source of movies (which, again, is stored within database).


btw: just got idea to use standard XBMC’s Library Export and Import. Those functions are accessible via setting->[video/music] and produce a TXT files. there you can find + replace (with a text editor, sed etc) and LOAD back.


Thanks. If I understand well you suggest that I use NFS and not CIFS but for a bug (unrelated to RaspBMC or OSMC and never solved) because of my directories being made of symlinks, NFS does not properly show all files and I di have to use CIFS.

So there’s no way to mount a CIFS export automatically at reboot ?

That would be a pain.

Take care.

you ARE sharing via NFS

this command you posted

root@osmc:/mnt# showmount --exports

is showing NFS shared directories.
and the mount on boot doesn’t work because it want to mount cifs, but such shares doesn’t exist.

symlinks on NFS shares is not problem, just you have to define such expots as “crossmnt”. that tells nfs server that if symlink goes “out” of it’s definition of export, it should allow the access too.
for instance you export /mnt/export1. in it you have a symlink to /mnt/export2. then /mnt/export1 must be defined as crossmnt and you have to define export definition for /mnt/export1 too. like this

/mnt/export1 *(insecure,crossmnt,no_squash)
/mnt/export2 *(insecure,no_squash)

then you can open directory /mnt/export1/export2 (pointing to /mnt/export2) also via NFS.


I humbly apologize for the confusion!

I mixed up showmount and smbclient :blush:

Yes you are correct. I also have an NFS share setup on RPI-B but after realizing some of my movies did not show up I then had to share also with SMB to overcome the symlink problem, despite NFS being so much faster.

I’ll now go back home tonight and try your suggestion on NFS sharing symlinks and if that works it would be AWESOME !

Thanks again and take care.