1

This is about nostalgia.

I have an old PC here running SuSE Linux 4.3 with Kernel 2.2.6. All hardware incl. ethernet is working fine and I am trying to mount an NFS share hosted by a recent Ubuntu 20.04.

Both PCs can ping each other and resolve their names via entries in /etc/hosts. FTP for example is working.

The export is:

/data   192.168.3.0/24(ro,no_subtree_check)

As I understand this will create an NFS v2/v3 export.

Trying to mount it results in:

nostalgy:/root # mount -t nfs linus:/data /data
mount: wrong fs type, bad option, bad superblock on linus:/data,
       or too many mounted file systems

In /var/log/messages on the client:

May 10 15:42:18 nostalgy kernel: nfs warning: mount version older than kernel
May 10 15:42:18 nostalgy kernel: call_verify: server accept status: 2
May 10 15:42:18 nostalgy kernel: RPC: garbage, retrying    0
May 10 15:42:18 nostalgy kernel: call_verify: server accept status: 2
May 10 15:42:18 nostalgy kernel: RPC: garbage, retrying    0
May 10 15:42:18 nostalgy kernel: call_verify: server accept status: 2
May 10 15:42:18 nostalgy kernel: RPC: garbage, exit EIO
May 10 15:42:18 nostalgy kernel: nfs_get_root: getattr error = 5
May 10 15:42:18 nostalgy kernel: NFS: cannot create RPC transport.

In /var/log/syslog on the server (after enabling debug logging with rpcdebug -m rpc -s all) is logged three times per mount attempt:

Jul 12 19:35:18 linus kernel: [25882.293061] svc: socket 00000000d25fa09a(inet 00000000ad30a7ef), busy=0
Jul 12 19:35:18 linus kernel: [25882.293096] svc: server 000000006bec18a0, pool 0, transport 00000000d25fa09a, inuse=2
Jul 12 19:35:18 linus kernel: [25882.293138] svc: svc_authenticate (1)
Jul 12 19:35:18 linus kernel: [25882.293144] svc: server 00000000ed86c4fe, pool 0, transport 00000000d25fa09a, inuse=3
Jul 12 19:35:18 linus kernel: [25882.293152] svc: server 00000000ed86c4fe waiting for data (to = 900000)
Jul 12 19:35:18 linus kernel: [25882.293173] svc: 192.168.3.4, port=800: unknown version (2 for prog 100003, nfsd)
Jul 12 19:35:18 linus kernel: [25882.293241] svc: socket 00000000d25fa09a sendto([00000000dc11bc2f 32... ], 32) = 32 (addr 192.168.3.4, port=800)
Jul 12 19:35:18 linus kernel: [25882.293245] svc: server 000000006bec18a0 waiting for data (to = 900000)
Jul 12 19:35:18 linus kernel: [25882.295154] svc: socket 00000000d25fa09a(inet 00000000ad30a7ef), write_space busy=0

I thought unknown version (2 for prog 100003, nfsd) maybe means the client is using NFSv2 while the server doesn't support it anymore. And indeed, in the old client the Kernel didn't have support for NFSv3 configured. But even after I did that and recompiled the Kernel, still the same error occurs.

On the server, nfsstat says:

Server rpc stats:
calls      badcalls   badfmt     badauth    badclnt
0          7          7          0          0

Both counts increase by 3 with each mount attempt which does 2 retries, so that matches. Are the badcalls/badfmt the unknown version (2 for prog 100003, nfsd)?

Output of rpcinfo -p:

dode@linus:~$ rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100005    1   udp  59155  mountd
    100005    1   tcp  44609  mountd
    100005    2   udp  56137  mountd
    100005    2   tcp  37447  mountd
    100005    3   udp  56639  mountd
    100005    3   tcp  57329  mountd
    100003    3   tcp   2049  nfs
    100227    3   tcp   2049
    100003    3   udp   2049  nfs
    100227    3   udp   2049
    100021    1   udp  34312  nlockmgr
    100021    3   udp  34312  nlockmgr
    100021    4   udp  34312  nlockmgr
    100021    1   tcp  34245  nlockmgr
    100021    3   tcp  34245  nlockmgr
    100021    4   tcp  34245  nlockmgr

When the server is running Ubuntu 14.04 (Kernel 4.4.0), 16.04 (Kernel 4.15) mounting the export works, when it is running 18.04 (Kernel 5.3) or later it fails.

I have also tried to disable NFS v4 like this

So maybe something relevant (RPC?) changed in Kernel 5?

10
  • 1
    Could the downvoter please explain? May 10, 2020 at 15:19
  • do /data exists on the NFS server (ie linux) ? May 18, 2020 at 2:14
  • Yes it does. With Kernel 4.x and the exact same NFS setup, the old Linux client can mount the export successfully. With Kernel 5.x it fails. May 18, 2020 at 16:22
  • Can you force the server to version 3 only ? May 18, 2020 at 23:35
  • rpc.nfsd can be instructed to offer only certain versions of nfs (3, 4, 4.0, 4.1) May 18, 2020 at 23:40

1 Answer 1

1

Finally I could get it to work.

Even though I compiled the kernel on the old SuSE machine with NFSv3 support, it still seemed to use v2. Maybe a kernel option is needed to enable v3?

On the Ubuntu 20.04 server, the command sudo cat /proc/fs/nfsd/versions returned:

-2 +3 -4 -4.0 -4.1 -4.2

so, no v2 support.

To enable v2, it was necessary to add -V 2 to RPCNFSDCOUNT in /etc/default/nfs-kernel-server:

# Number of servers to start up
RPCNFSDCOUNT="8 -V 2 --no-nfs-version 4"

Then just a restart of nfs-kernel-server for the changes to take effect:

sudo systemctl restart nfs-kernel-server

After that, mounting NFS exports on the old SuSE machine worked again :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .