Configuring fstab based NFS share mounts


But honestly, this is out of my league… :joy: Does anybody like @grahamh or @fzinken have any ideas?
It’s a setup I haven’t tried myself yet and technically the NFS server doesn’t need to wait for the network to be ready, but for the mount process of USB devices… How could that be forced to happen?


So this is a matter of timing in the Vero. The NFS server won’t start if the mountpoint doesn’t exist. That’s why I mount my shared drive in /mnt. If you mkdir /mnt/USBDRIVE on the vero then /mnt/USBDRIVE is always there and NFS server will share it even it’s a bare directory. Then when it gets mounted (via fstab on the vero) you are good to go.


OK, this is a good argument to mount the drive manually via fstab instead of relying on automount.

But then I will not be able to “remove safely” via Kodi File Manager anymore, right?


Probably not. But you said you only want to do his occasionally so just power down.

Edit: You can ‘remove safely’ if you add users as an option in fstab and make sure no-one is connected to the drive. But you will still have to reboot to mount it again.


I also need to be able to access the drive via SMB. Only automounted drives are added to SMB share automatically. I can imagine this is going to lead to issues as well (I am really not a regular Linux user).

I really prefer automounting, unless manually mounting would also have performance advantages (with NTFS specifically).


So why are you bothering with NFS? Just let OSMC’s automount mount it on server (vero). Then from other devices look for the share using SMB.


Because I need both. NFS for the connection between OSMC devices, SMB for file access from Windows :slight_smile:


Your setup is becoming more and more unusual :rofl:


Not really. It is actually quite simple:

  1. I want 1 device running Flexget, Transmission, SyncThing, Spotify-Connect, Kodi.
  2. Flexget and Transmission should run via OpenVPN. Others should not since that will lead to playback issues for my legal local stream add-ons and performance issues with stuff like SyncThing.

None of the solutions provided in this topic have worked successfully yet to run specific apps via VPN. That’s why I use 2 devices for now:

In December I bought a Vero 4K. I now use my RPi3 purely for Flexget+Transmission, running OpenVPN.
My Vero 4K is my main playback device. I also use UPNP Library to share my library on the Vero 4K to RPi2’s in other rooms. Therefore, the USB NTFS drive is connected to the Vero 4K.

To give the RPi3 “download box” speedy access to the Usbdrive, since that’s my only storage, I use NFS.

Furthermore, I have Windows laptops for private use or for business and Android phones. Each one should be able to access the USB drive. It contains my photo backup and some documents. So Samba is active on the Vero.

Everything works smoothly. I just have to manually start NFS-server (I could probably add it to MyOSMC) if I ever reboot the Vero.


Ok, I see…

It doesn’t sound like a very “speedy” solution at all as this all goes through a fast ethernet port of the Vero 4k, but as long as it serves your needs :+1:t2:

As @grahamh suggested before, why not try using SMB here and see, if there are any performance issues at all. As long as everything’s working fine, why make it complicated?


How should that limit anything? The RPi3 has its own hardware limitations. I am just making sure the connection is efficient and with as little overhead possible. The Vero 100mbit connection is way more than needed for the limited download speed I can achieve on my RPi (which is more than enough since Flexget automates everything, I am never waiting for downloads, content is ready to watch).

Actually in my test setup it works just fine via Wifi! Only the RPi3 is currently connected via cable. The Vero will be in a few days.

Edit: I actually thought NFS was the best choice I thought SMB would be slow and have massive overhead. But I’ll test!


In addition to the UPNP server you mentioned this. That’s what I meant by “this all goes through a fast ethernet port of the Vero 4k”. I was just wondering… My whole network is GBit and this would surely be limiting when it comes to moving data around. But if it’s all fine for you, sure don’t change a running system. :wink:

It may fix performance issues, if there are any, but doesn’t need to be used for the sake of using it. Just try SMB and see whether it gives decent performance, too. Maybe it makes things easier and straightforward in your setup :+1:t2:


Instead of changing stuff, I added 1 line to /lib/systemd/system/nfs-server.service file [unit] section:


Perhaps I should have added a file with just this line in /etc/systemd/system/nfs-server.service because I believe you are not suppose to change stuff in /lib/ manually?

But this works perfectly!


Posted not to this disscussion


Is it advisable to use the /mnt directory vs a user based mount like /home/osmc/mnt for fstab nfs shares? I have working root /mnt based access and it seems to be working fine however, Sam mentioned a while ago to use user based access to fstab shares. Just want best practice. TIA


That is your answer.


Just a suggestion:

If you place the parm -v to the mount command, you can follow the version negotiation process/sequence which might help to understand version related issues occuring, here.

If you do not see your files, try this:

sudo mount -v /mnt/Server_Movies

Or if you used the TV Shows example (TV\040Shows):

sudo mount -v /mnt/TV\ Shows


Using root directory is probably not the best option. I have made /home/osmc/mnt directory for my fstab nfs mounts and all is working as expected.


Why is that?


Simply because OSMC is set up as a user on the underlying Linux base. Sam has mentioned in the past that it is advisable to use the /home/osmc directory. I’ll see if I can dig up the post. Granted it’s from a few years ago so maybe not entirely relevant anymore. Truth of the matter is it works both ways.