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
Cause
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 are combinations that work and some that fail, with various reasons and exceptions within the logic.
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:13-Mar-2024
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com