Using 'cd /net/host' on RHEL6 mounts NFSv3 instead of NFSv4
Environment
- Red Hat Enterprise Linux 6 (RHEL6) NFS server
- RHEL6 NFS client with autofs active and working
Issue
On a RHEL6 client, when changing current folder to an automounted directory /net/host, the NFS share is mounted using NFSv3 instead of NFSv4.
Resolution
On the server remove the fsid=0 parameter from the options of the exported mountpoint that is intended to be mounted with NVFv4 on the client.
Root Cause
Using fsid=0 the client receives a "No such file or directory" error when trying to mount using NFSv4 and it falls back to v3.
Quoting the man section for exports:
For NFSv4, there is a distinguished filesystem which is the root
of all exported filesystem. This is specified with fsid=root or
fsid=0 both of which mean exactly the same thing.
Diagnostic Steps
On the NFS server, put in /etc/exports:
/myexport *(rw,fsid=0,sync)
On the client try to mount the share manually forcing NFSv4:
[root@client /]# mount -t nfs -o nfsvers=4 server:/myexport /mymtpoint
mount.nfs: mounting server:/myexport failed, reason given by server:
No such file or directory
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
