You can use any of your existing users by adding -U <username> to the command.
Works on both old and new.
osmc@osmc:~$ smbclient -U james -L 192.168.0.25
Enter WORKGROUP\james's password:
Sharename Type Comment
--------- ---- -------
Apps Disk Applications
Backup Disk
eBooks Disk
Misc Disk
Movies Disk
Music Disk System default shared folder
NetBackup Disk System default shared folder
Photos Disk
TV Disk
IPC$ IPC IPC Service ()
SMB1 disabled -- no workgroup available
osmc@osmc:~$ smbclient -U james -L 192.168.0.22
Enter WORKGROUP\james's password:
Sharename Type Comment
--------- ---- -------
data Disk
misc Disk
IPC$ IPC IPC Service (Media server)
SMB1 disabled -- no workgroup available
Then you should be able to connect from Kodi using the James user.
alternatively can also use SMB with autofs
I’d take a look at the passwords.xml file I mentioned previously to make sure this is what is actually happening.
In passwords.xml it has:
osmc@osmc:~/.kodi/userdata$ cat passwords.xml
<passwords>
<path>
<from pathversion="1">smb://nas01/data</from>
<to pathversion="1">smb://james:<PASSWORD>@nas01/data</to>
</path>
</passwords>
So your Kodi source is setup using a hostname instead of an IP address? Did you try running that smbclient command from your Vero using the hostname to make sure you didn’t have a name resolution issue?
You might also try in Kodi going to Settings>Services>SMB and dropping the max protocol version to v2 in case there is some kind of an issue with negotiating the correct SMBv3 version.
The first 2 attempts at adding it, I used the IP address, so how that particular info ended up in passwords.xml I cannot say. Each time I simply tried to add the source via the Kodi interface.
I’m just thinking out loud here, given that I don’t want to actually add a source (I was only doing it to test that the connection would work) am I better to use autofs and then update the pathsubstitution?
I’m still not overly happy with using SMB as my understanding is performance on the Photos share won’t be as good as using NFS, but if that’s the only way… then I suppose it’ll have to do. Would it be correct then also, that I then set the ‘to’ path to the new smb mount?
That hostname doesn’t work, I’d have to add .lan to it. I’ve updated passwords.xml using nano to set it to the IP instead (as my primary NAS will always have that IP). How should I test if that’s working now? Or am I best just to follow the autofs guide, add it that way and once mounted test the dir contents show. Then once that’s done, update my pathsubstition path?
Performance shouldn’t really be an issue. NFS should be faster, but SMB on a V shouldn’t be that far behind and still comfortably faster than the bit rate of any file you would be streaming to it.
Adding a Kodi source isn’t going to hurt anything or mess up your current library as long as you don’t add a scraper to it (ie in content set “This directory contains” to “none”) and you can leave it or delete it as you wish. To test you just navigate to is via videos>files or settings>media>library>videos> and if you can browse and play from there then your good. To test a system mount you can just add a new source and point it to where you created the new mount point.
As for a system mount that should pose no issue once you get it working using path substitution to redirect to a local path. I cover that in the howto I had linked. It is basically just a ‘find and replace’ when Kodi follows a file path so as long as you set it up correctly to make the new path valid it should leave you with a working library.
Well, despite the above - autofs doesn’t work.
Output from sudo automount -f -v -d
master_do_mount: mounting /-
automount_path_to_fifo: fifo name /var/run/autofs.fifo--
lookup_nss_read_map: reading map file /etc/auto.nfs.shares
do_init: parse(sun): init gathered global options: (null)
lookup_nss_read_map: reading map file /etc/auto.smb.shares
do_init: parse(sun): init gathered global options: (null)
mounted direct on /mnt/nas01/data with timeout 15, freq 4 seconds
do_mount_autofs_direct: mounted trigger /mnt/nas01/data
st_ready: st_ready(): state = 0 path /-
handle_packet: type = 5
handle_packet_missing_direct: token 25, name /mnt/nas01/data, request pid 22417
attempting to mount entry /mnt/nas01/data
lookup_mount: lookup(file): looking up /mnt/nas01/data
lookup_mount: lookup(file): looking up /mnt/nas01/data
lookup_mount: lookup(file): /mnt/nas01/data -> -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc smb://192.168.0.22/data
parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc smb://192.168.0.22/data
parse_mount: parse(sun): gathered options: fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc
parse_mount: parse(sun): dequote("smb://192.168.0.22/data") -> smb://192.168.0.22/data
parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc, loc=smb://192.168.0.22/data
sun_mount: parse(sun): mounting root /mnt/nas01/data, mountpoint /mnt/nas01/data, what smb://192.168.0.22/data, fstype cifs, options rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc
do_mount: smb://192.168.0.22/data /mnt/nas01/data type cifs options rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc using module generic
mount_mount: mount(generic): calling mkdir_path /mnt/nas01/data
mount(generic): calling mount -t cifs -o rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc smb://192.168.0.22/data /mnt/nas01/data
>> Mounting cifs URL not implemented yet. Attempt to mount smb://192.168.0.22/data
mount(generic): failed to mount smb://192.168.0.22/data (type cifs) on /mnt/nas01/data
dev_ioctl_send_fail: token = 25
handle_packet: type = 5
handle_packet_missing_direct: token 26, name /mnt/nas01/data, request pid 22417
dev_ioctl_send_fail: token = 26
failed to mount /mnt/nas01/data
Credentials are set in ~/.smbcredentials
This is my entry in /etc/auto.smb.shares
/mnt/nas01/data -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc smb://192.168.0.22/data
If I go to Settings > Services > SMB Client minimum is set to None and Maximum is set to SMBv3.
I’ve tried adding vers=3.0 and vers=3.1.1 as per Mounting network shares with autofs (alternative to fstab) - #103 by karl but neither helped.
I’m really not sure what else I can try here?
Regarding NFS which is failing, if I look at Settings > Services > NFS Client, NFS Protocol version is set to 3.
In any case, I’ve got NFS mounted via autofs now - it came down to a simple typo / case of PEBKAC! I’m so used to /usr/ that I had typed that, rather than /user/ in auto.nfs.shares.
So now:
osmc@osmc:/mnt/nas01/data$ ls -lah
total 432K
drwxrwxrwx 1 99 users 129 Oct 20 21:00 .
drwxr-xr-x 3 root root 4.0K Oct 23 11:26 ..
drwxrwxrwx 1 osmc users 4.0K Oct 20 12:43 Apps
drwxrwxrwx 1 osmc users 4.0K Oct 21 20:10 Backup
drwxrwxrwx 1 osmc users 56K Oct 21 07:20 Movies
drwxrwxrwx 1 osmc users 148K Oct 22 07:52 Music
drwxrwxrwx 1 osmc users 16K Oct 21 14:11 Photos
drwxrwxrwx 1 osmc users 20K Oct 22 07:04 TV
drwxrwxrwx 1 osmc users 76K Oct 21 07:50 eBooks
Time to update the pathsubstitution and change it and test. I still have no idea though, why autofs wouldn’t work with smb even though smbclient -L worked fine!
Success! With some caveats… ![]()
OK, so autofs is working as I can now browse /mnt/nas01/data:
osmc@osmc:/mnt/nas01/data$ ls -lah
total 432K
drwxrwxrwx 1 99 users 129 Oct 20 21:00 .
drwxr-xr-x 3 root root 4.0K Oct 23 11:26 ..
drwxrwxrwx 1 osmc users 4.0K Oct 20 12:43 Apps
drwxrwxrwx 1 osmc users 4.0K Oct 21 20:10 Backup
drwxrwxrwx 1 osmc users 56K Oct 21 07:20 Movies
drwxrwxrwx 1 osmc users 148K Oct 22 07:52 Music
drwxrwxrwx 1 osmc users 16K Oct 21 14:11 Photos
drwxrwxrwx 1 osmc users 20K Oct 23 11:30 TV
drwxrwxrwx 1 osmc users 76K Oct 21 07:50 eBooks
I then updated advancedsettings.xml with:
<to>/mnt/nas01/data/</to>
It seems to be working.
I can see the connection on my new NAS if I look at syslog:
Oct 23 11:26:23 NAS01 rpc.mountd[5597]: v4.2 client attached: 0x6af2525668f872d3 from "192.168.0.100:1012"
Oct 23 11:30:06 NAS01 emhttpd: read SMART /dev/sdc
Oct 23 11:30:30 NAS01 rpc.mountd[5597]: v4.0 client attached: 0x6af2525768f872d3 from "192.168.0.100:835"
Oct 23 11:30:31 FWLONNAS01 emhttpd: read SMART /dev/sdb
Oct 23 11:32:01 FWLONNAS01 rpc.mountd[5597]: v4.0 client detached: 0x6af2525768f872d3 from "192.168.0.100:835"
I set Settings > Services > NFS Client > NFS Protocol Version from 3 to 4, I’m not sure if that made a difference.
When I go to Videos > Files > Add Videos > Browse > Network File System (NFS) – I can still only see NAS02 (the old NAS) and not the old NAS, so no idea why NAS01 isn’t showing up there still. Any thoughts on that? I guess it largely becomes a problem if I ever want to add a new source?
I took a quick look at this confusing thread: If you’ve already configured the desired access to your NFS server in the local file system at /mnt/nas01/data using autofs, there’s absolutely no reason to use the media center’s NFS stack for this. Instead, simply select the root file system and the path where the NAS is mounted:
Not that it matters now since you got the NFS system mount working, but this SMB attempt failed because you added “smb” to the IP address. It should have looked like this…
/mnt/nas01/data -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.1.1 ://192.168.0.22/data
Maybe try rebooting your router. In the add source section of Kodi you can also try doing an add network location where you just manually add that IP address so you sidestep Kodi having to Find the new NAS. Although that would probably be a bit pointless now as well since if you needed to add an additional source the most logical thing to do would be to add it manually via autofs like you have done now with your current data.
I didn’t add smb in the entry in auto.smb.shares - autofs seems to have automatically added that when it translated from smb shares to the command it then runs.
Router has been rebooted, no difference. Not to worry, per the previous post it looks like I can just add a new source (if I ever have to) by using Root Filesystem. It’s still an odd one, though!
You sure? You posted “This is my entry in /etc/auto.smb.shares” showing exactly that.
Yes, I’m sure. Thats what I tried as an outside the box solution (which also didnt work). My initial one that also failed was just //IP/data.
