Autofs still trying to contact portmapper for nfs4

I’m trying to mount an nfs4 share using autofs. Here are the relevant config files:

/etc/autofs/server.nfs
------------------------
/mnt/server -fstype=nfs4,rw,soft,port=2049,rsize=8192,wsize=8192 server-ts:/mnt/storage
/etc/autofs/auto.master.d/server.autofs
-----------------------------------------
/- /etc/autofs/server.nfs --timeout=600 --ghost

This setup works. You will notice that I have to specify port=2049. If I don’t, by running sudo automount -f -v -d, I get the following error:

get_portmap_client: host not reachable getting portmap client

Looks like autofs is trying to talk to portmapper, which doesn’t exist since nfs4 does not need it. According to this discussion, the bug should be fixed by now. Does anyone else face this issue?

1 Like

I have autofs running on manjaro with an ubuntu nfs server.

My automap options are all -fstype=nfs4,nodev,nosuid,async and the mount table entries all show nfs4 mount, not a different version. Mount options expand to:

rw,nosuid,nodev,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,local_lock=none

I am still running rpcbind on the nfs server.

# rpcinfo -p server|grep 2049
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    3   tcp   2049  nfs_acl

Maybe not what you want, but it works, but then specifying the port seems to work for you too.

Yeah, I think this is what the client is looking for. But it should not, since nfs4 doesn’t need it. It’s a bit strange.

man 5 nfs manjaro:

port=n         The  numeric value of the server's NFS service port.  If the server's NFS service is not available on
               the specified port, the mount request fails.

               If this option is not specified, or if the specified port value is 0, then the NFS  client  uses  the
               NFS  service  port number advertised by the server's rpcbind service.  The mount request fails if the
               server's rpcbind service is not available, the server's  NFS  service  is  not  registered  with  its
               rpcbind service, or the server's NFS service is not available on the advertised port.
$ pacman -Q | grep nfs | grep -Ev 'qemu|gvfs'
libnfs 5.0.2-1
nfs-utils 2.6.3-1
nfsidmap 2.6.3-1
$ pacman -F /usr/share/man/man5/nfs.5.gz
usr/share/man/man5/nfs.5.gz is owned by core/nfs-utils 2.6.3-1

man 5 nfs ubuntu:

port=n         The numeric value of the server's NFS service port.  If the server's NFS service is not available  on
               the specified port, the mount request fails.

               If this mount option is not specified, the NFS client uses the standard NFS port number of 2049 with‐
               out first checking the server's rpcbind service.  This allows an NFS version 4 client to  contact  an
               NFS version 4 server through a firewall that may block rpcbind requests.

               If  the specified port value is 0, then the NFS client uses the NFS service port number advertised by
               the server's rpcbind service.  The mount request fails if the server's rpcbind service is not  avail‐
               able,  the  server's NFS service is not registered with its rpcbind service, or the server's NFS ser‐
               vice is not available on the advertised port.
# dpkg -l|awk '/nfs/{print $2, $3}'
libnfs13:amd64 4.0.0-1build2
libnfsidmap1:amd64 1:2.6.2-4ubuntu1
nfs-common 1:2.6.2-4ubuntu1
nfs-kernel-server 1:2.6.2-4ubuntu1
# dpkg -S /usr/share/man/man5/nfs.5.gz
nfs-common: /usr/share/man/man5/nfs.5.gz

Interesting differences. I expect arch is slightly more up to date than ubuntu, but also expect that means the more flexible configuration too, not more restrictive. Maybe ubuntu has back ported something from upstream?

1 Like

That might be the case. I checked that AlmaLinux also has a manpage similar to Arch. The link I gave was in RedHat’s forum, which says that this has been patched. But Alma is supposed to match RHEL. This is kind of confusing.

Have you checked man 5 nfs on your nfs client? Also the package versions? Given the link to bugazilla was 2012, I agree I hope it was fixed too, but depends on how much hassle it caused as to how much attention it get I guess.

My NFS client is EOS, it’s the same as your Manjaro output. All the latest packages.

Well, at least the function matches the documentation, irritating as it may be. Not matching the documentation is worse.