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

SUSE Linux Enterprise Server 15

Situation

A setting for nfs version (such as "nfsvers=3") has been set in /etc/nfsmount.conf.  Later, an nfs mount is attempted from the command line or /etc/fstab with a different version.  This may fail depending on the syntax.

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

At this time, it is best not to set an NFS version in /etc/nfsmount.conf.  This is expected to remain true at least through SLES 15 SP4, possibly longer.

Inclusion of a fix will be addressed in the future.

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 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:05-May-2022
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center