NFS version 2 server connect with version 4 on raspberry pi?

Hello,

I’m running an nfs server on my asus router running entware. Unfortunately, only version 2 of the server is available on that platform. While trying to set up the client on my osmc installation to connect to the server, it refuses to do so. I’ve adjusted a few lines in the export file like adding an insecure flag, but no go.

Does anyone know how I can install version 2 of the nfs server on osmc?

Thanks!

If you are speaking about NFS version 2 (protocol), then this is quite old!

If you could get the log so we could look at the error message, we could get a better idea of what is going on. I’m not able to tell whether you’re trying to connect to the share via Kodi or /etc/fstab at the moment either.

S

Sorry, I tried connective via Kodi, but obviously that gave me an error with no details. Then I tried it via modifying fstab, but it yielded the same results. Here’s is the contents of my /etc/exports file on the server:

/mnt/opt/Media * (rw,fsid=0,all_squash,no_subtree_check,async,insecure)

Here’s what’s in my fstab on osmc:

GNU nano 2.2.6 File: /etc/fstab

/dev/mmcblk0p12 /boot vfat defaults,noatime 0 0
/dev/mmcblk0p13 / ext4 defaults,noatime 0 0
192.168.1.:/opt/Media /home/nfs nfs rw 0 0

This is what happens when I try to mount the share on my pi:

osmc@osmc:~$ sudo mount 192.168.1.1:/opt/Media /home/nfs
-bash: mount.nfs:: command not found

Thanks for the help!

Also, I meant to ask how to install version 2 of the nfs client, not server on my pi2.

Debug logging will give you the error.

Our kernel ships with NFS support for Versions 3 and 4. Try nfsvers=3. See OSMC Alpha 2: Problem mounting nfs share at boot via fstab - #8 by spacemanspiff for more information

Sam

Tried it with version 3:

mount.nfs: timeout set for Fri May 22 03:56:02 2015
mount.nfs: trying text-based options ‘vers=4,addr=192.168.1.1,clientaddr=192.168.1.193’
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options ‘addr=192.168.1.1’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.1.1 prog 100003 vers 3 prot TCP port 988
mount.nfs: portmap query retrying: RPC: Program/version mismatch
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: trying 192.168.1.1 prog 100003 vers 3 prot UDP port 986
mount.nfs: portmap query failed: RPC: Program/version mismatch
mount.nfs: Protocol not supported

It seems like my server does not support 3 or 4. Is there any way to fix this?

How old is the router?

The router is actually only a year or so old, but I managed to get nfs protocol version 3 running on the router! Turns out, I installed the userspace package which was outdated but the one for the kernel is 3.

But now, I have another issue when i try to mount with sudo mount -av:

mount.nfs: trying text-based options ‘intr,addr=192.168.1.1’
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.1.1 prog 100003 vers 3 prot TCP port 25
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.1.1 prog 100005 vers 3 prot UDP port 40551
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.1.1:/opt/Media

Here’s my fstab file:
/dev/mmcblk0p12 /boot vfat defaults,noatime 0 0
/dev/mmcblk0p13 / ext4 defaults,noatime 0 0
192.168.1.1:/opt/Media /home/nfs nfs defaults,user,auto,intr,rw,noatime 0 0

and here’s the modified exports:

/opt/Media * (rw,no_all_squash,no_subtree_check,async,insecure)

Any idea? Thanks again!

Maybe some of this can help you out. Sounds like we’ve got similar setups.

Router:

ASUSWRT-Merlin RT-N16_3.0.0.4 Sat Feb  7 01:45:11 UTC 2015
admin@RT-N16:/tmp/home/root# cat /etc/exports 
/mnt/Main 192.168.1.0/24(no_root_squash,rw,sync,no_root_squash,insecure)

Pi:

osmc@osmc:~$ cat /etc/fstab 
192.168.1.1:/tmp/mnt/Main /mnt/Main nfs rsize=8192,wsize=8192,timeo=14,intr,rw,user,x-systemd.automount, noauto