Issue to connect to NAS with autofs NFS/SMB

Assuming ls -lah /mnt/share now shows your files?

Then adapt your auto.smb.shares as follows

/mnt/share -fstype=cifs,rw,username=mattsnas,password=<password>,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0 ://192.168.1.2/share

Then
sudo umount /mnt/share
sudo rmdir /mnt/share
sudo systemctl restart autofs

Yes ls -lah /mnt/share now shows the folders!!

Done all the rest as you mentioned above. So now how do I actually use these shared folders? Go back into media and browse SMB shares?

No you now can simply add them to Kodi via the point “Root Filesystem”, from a Kodi point of view this is now a local folder it doesn’t know about the mounting of the NAS that happens in the background.
E.g. add a source for your movies by choosing Root Filesystem and then en browse to /mnt/share/Movies`

Did you do a restart to check it is cleanly mounted after a restart?

Looks like it’s not working after a reboot:

osmc@osmc:~$ ls -lah /mnt/share
ls: cannot open directory '/mnt/share': No such file or directory
osmc@osmc:~$

Can you check your auto.smb.shares, I made a mistake in my command, correct one should be

/mnt/share -fstype=cifs,rw,username=mattsnas,password=<password>,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0  ://192.168.1.2/share

While I wonder how it worked after the last commands I gave.

1 Like

I wondered about that… (not that I know ANYTHING about Linux syntax…)

After reboot now:

osmc@osmc:~$ ls -lah /mnt/share
total 4.0K
drwxr-xr-x 2 osmc osmc    0 May  9 21:35 '#recycle'
drwxr-xr-x 2 osmc osmc    0 May  9 18:07  .
drwxr-xr-x 5 root root 4.0K May 10 16:30  ..
drwxr-xr-x 2 osmc osmc    0 May  8 21:08  Backups
drwxr-xr-x 2 osmc osmc    0 Jul  9  2019 'Books from Godfrey Haugh'
drwxr-xr-x 2 osmc osmc    0 Apr 14 09:46  Movies
drwxr-xr-x 2 osmc osmc    0 Jan 24  2021 'System Volume Information'
drwxr-xr-x 2 osmc osmc    0 May  9 13:38 'TV series'
drwxr-xr-x 2 osmc osmc    0 May  9 14:26  matt

Great so now just add it as source as indicated above and you are all set

1 Like

Awesome!!!

Appears to me that the NFS mount pointed at the wrong IP address. .2 but in the screen shot, it shows as .24.

NFS isn’t user-to-server authentication. It is server-to-server authentication with user’s getting native Unix file and directory permissions control. This means that having both the NFS client AND the NFS server with static IPs is the key part of the security. Of course, if you want more security, you can setup Kerberos trust between the systems, but that’s a hassle. If you want encrypted transfers, Kerberos is required. Basically, with normal NFS, there aren’t any user/password credentials exchanged without Kerberos (optional).

CIFS/Samba are user-to-server authentication with all the liabilities that includes.

I bet that
$ showmount -e xxx.xx.xx.2
would have shown the expected NFS service and any shared storage, if any are configured.

In OSMC, we can either mount storage using the OSMC GUI or let the operating system handle it. If we let the OS handle it, then OSMC doesn’t need to know anything about that and we just need to point at the directories like they were all local. This is how I do music to my OSMC playback devices. For video, I prefer to have a DLNA server (Jellyfin) provide the streams for TV, Movies, videos, and transcode to the format I want, when needed. Jellyfin runs on an x86-64 system with plenty of storage.

As for autofs … on the client side, there are 2 config files.

  • /etc/auto.master
  • /etc/auto.nfs
    auto.master points at auto.nfs. We could name it anything, but using that name just for nfs mounts seems reasonable. The important line in auto.master should look like this:
    /- /etc/auto.nfs

Inside auto.nfs, I have mounts like this:

/d/D1 -fstype=nfs,nconnect=4,proto=tcp,rw,async  istar:/d/D1
/d/D2 -fstype=nfs,nconnect=4,proto=tcp,rw,async  istar:/d/D2
/d/D3 -fstype=nfs,nconnect=4,proto=tcp,rw,async  istar:/d/D3

Under each of those different file systems, I have TV, Movies, Video directories. So, when I setup the TV library, there are 3 lines …

  • /d/D1/TV
  • /d/D2/TV
  • /d/D3/TV
    and OSMC merges all the content for me.
    Of course, backups for each of those file systems are in
  • /d/b-D1/TV
  • /d/b-D2/TV
  • /d/b-D3/TV
    I didn’t want to confuse myself. I originally started with /d/D1 … and added content until it was full. Then I added D2 … D3 and at this point, I’m removing content to make room for new stuff.
    I also go out of my way to mount the NFS storage in the same place it resides on the NFS server. Again, this is to limit my confusion when I’m working on different systems. The NFS server is also where Jellyfin runs. I don’t have a dedicated NAS box. My NFS server is just another Linux system here.

Updates: Struck out the initial, incorrect, statement. Corrected showmount IP address. Decided to leave this post for future lurkers to see autofs, gain a little NFS config examples and consider some options and choices to allow more storage to be added.

Is the server (NAS)

Is the client (OSMC)

And it obvisloy worked at this point

So can you please explain the purpose of your whole post for something that is already solved?

1 Like

Mainly, I hate to see people using CIFS. The OP wanted an NFS autofs solution. At least that was what I saw. The last few posts were all about using CIFS.

I feel that showing exactly what to type is 50% of most questions. The deeper understanding for why and how experienced people do things can provide a little future-proofing. Avoiding future issues is part of being a good admin.

Appears that my skimming of the middle posts missed some details and that I mixed up the IPs for the client and server. I’ve never used a GUI to setup NFS - that post drew my eye - missing the working showmount post a few replies higher. Sorry for any confusion.

Should I attempt to correct my post above or just remove all contents? Decided to edit the post so lurkers can see more examples of working autofs NFS mounts.

Well I also promote NFS but if you have a working CIFS solution I would not bother to change.

As mentioned I think the problem was solved so from my point just can delete the post.