#StackBounty: #linux #nfs Embedded NFS server doesn't support ver=2, but supports 1,3 – is this possible?

Bounty: 100

My 2.6.37 Linux from MontaVista has NFS modules compiled. I start them sequentially as:

rpcbind
rpc.nfsd 4
rpc.mountd
rpc.statd

with default config files and etab as:

/mnt/sda1 192.168.50.0/24(rw,sync,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,no_subtree_check,secure_locks,acl,fsid=1,anonuid=65534,anongid=65534)

Everything works fine with my FC32 as a client:

[root@leonp mnt]# mount -v 192.168.1.1:/mnt/sda1/ srv
mount.nfs: timeout set for Mon Aug  3 16:04:08 2020
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.1.1,clientaddr=192.168.1.57'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.1.1,clientaddr=192.168.1.57'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4,addr=192.168.1.1,clientaddr=192.168.1.57'
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 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.1.1 prog 100005 vers 3 prot UDP port 39445
[root@leonp mnt]#

The problem starts when I try to connect with the client which supports NFSv2 only. So to test from PC:

[root@leonp mnt]# mount -vvv -o vers=2 192.168.1.1:/mnt/sda1/ srv
mount.nfs: timeout set for Mon Aug  3 13:50:14 2020
mount.nfs: trying text-based options 'vers=2,addr=192.168.1.1'
mount.nfs: prog 100003, trying vers=2, prot=6
mount.nfs: trying 192.168.1.1 prog 100003 vers 2 prot TCP port 2049
mount.nfs: prog 100005, trying vers=1, prot=17
mount.nfs: trying 192.168.1.1 prog 100005 vers 1 prot UDP port 36357
mount.nfs: mount(2): Protocol not supported
mount.nfs: Protocol not supported

Why this? I checked:

[root@leonp mnt]# rpcinfo 192.168.1.1 
   program version netid     address                service    owner
    100000    4    tcp       0.0.0.0.0.111          portmapper superuser
    100000    3    tcp       0.0.0.0.0.111          portmapper superuser
    100000    2    tcp       0.0.0.0.0.111          portmapper superuser
    100000    4    udp       0.0.0.0.0.111          portmapper superuser
    100000    3    udp       0.0.0.0.0.111          portmapper superuser
    100000    2    udp       0.0.0.0.0.111          portmapper superuser
    100000    4    local     /var/run/rpcbind.sock  portmapper superuser
    100000    3    local     /var/run/rpcbind.sock  portmapper superuser
    100003    2    tcp       0.0.0.0.8.1            nfs        unknown
    100003    3    tcp       0.0.0.0.8.1            nfs        unknown
    100003    2    udp       0.0.0.0.8.1            nfs        unknown
    100003    3    udp       0.0.0.0.8.1            nfs        unknown
    100021    1    udp       0.0.0.0.148.56         nlockmgr   unknown
    100021    3    udp       0.0.0.0.148.56         nlockmgr   unknown
    100021    4    udp       0.0.0.0.148.56         nlockmgr   unknown
    100021    1    tcp       0.0.0.0.228.206        nlockmgr   unknown
    100021    3    tcp       0.0.0.0.228.206        nlockmgr   unknown
    100021    4    tcp       0.0.0.0.228.206        nlockmgr   unknown
    100005    1    udp       0.0.0.0.142.5          mountd     superuser
    100005    1    tcp       0.0.0.0.130.95         mountd     superuser
    100005    2    udp       0.0.0.0.218.108        mountd     superuser
    100005    2    tcp       0.0.0.0.174.251        mountd     superuser
    100005    3    udp       0.0.0.0.154.21         mountd     superuser
    100005    3    tcp       0.0.0.0.132.150        mountd     superuser

The only one who does not support v2 is nlockmgr – can it be the cause of mount refusal?
To test this I tried to remove nlockmgr from running – no success. I tried to block it in /etc/rpc by commenting out 100021 – no success.

Any help will be highly appreciated.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.