NFS mount attempt with vers=n returns "invalid argument" or "incorrect mount option"
This document (000020653) is provided subject to the disclaimer at the end of this document.
Environment
Situation
An example mount attempt with verbose output:
dp-sles15sp3:~ # mount -vvv -o vers=4.1 10.10.200.40:/export /mnt1
mount.nfs: timeout set for Wed Nov 18 14:15:25 2021
mount.nfs: trying text-based options 'vers=4.1,nfsvers=3,addr=10.10.200.40,clientaddr=10.10.200.43'
mount.nfs: mount(2): Invalid argument
mount.nfs: an incorrect mount option was specified
As shown in the output above, this resulted in 2 versions being specified in the mount command, which may not be handled well in certain combinations. Using the -s or "sloppy" mount option does not help.
Resolution
This is addressed in SLES 15 SP6 and SP7 within the nfs-client package v2.6.4. This was initially fixed in upstream linux code in v2.5.3, but by the time SLES 15 SP6 was put together, the code and version number were further updated.
For SLES 15 SP5 or lower (including SLES 12 SP5), the recommended solution is not to set an NFS version in /etc/nfsmount.conf.
Cause
The code responsible for merging options together is found in mount.nfs, part of the nfs-client package, which is built from the nfs-utils source code package. Use of /etc/nfsmount.conf and the code to merge its options with others is a relatively new development.
If different NFS versions are specificed in /etc/nfsmount.conf and elsewhere (such as /etc/fstab, on the command line, or possibly autofs maps), various logic comes into play to determine which version will be used. This is further complicated by the fact that "vers=" is considered an alias of "nfsvers=" but could be handled differently by some code. There have been combinations that work and some that fail, with various reasons and exceptions within the logic.
Additional Information
The package "nfs-client" is just one of several packages built from the source package "nfs-utils". For example, "nfs-kernel-server" is also built from "nfs-utils". Sometimes the name "nfs-utils" is used instead of the others, which can be accurate but still confusing, because "nfs-utils" is not a compiled package name that exists within current shipping SLES distributions.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000020653
- Creation Date: 05-May-2022
- Modified Date:07-Aug-2025
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com