Troubleshooting “mount.nfs: an incorrect mount option was specified” Error on CentOS 7.2 NFS Setup


3 views

When attempting to mount an NFS share between CentOS 7.2 systems, you're encountering a persistent error indicating incorrect mount options. The basic mount command fails with:

mount.nfs: an incorrect mount option was specified

This occurs despite:

  • Proper NFS utils installation (nfs-utils-1.3.0)
  • Valid exports configuration
  • Functional showmount responses
  • No apparent firewall issues

Key system messages reveal important context:

[44428.405419] nfsd: last server has exited, flushing export cache
[ 7.373186] FS-Cache: Netfs 'nfs' registered for caching
[ 8.474503] NFSD: starting 90-second grace period

The verbose mount attempt shows version negotiation:

mount.nfs: trying text-based options 'vers=4,addr=162.xxx.xxx.94,clientaddr=162.xxx.xxx.6'

First, verify kernel NFS support:

# Check loaded NFS modules
lsmod | grep ^nfs

# Verify filesystem support
grep nfs /proc/filesystems

Solution 1: Specify NFS Version Explicitly

# Try forcing NFSv3
mount -t nfs -o vers=3 nfs1.example.com:/var/nfs/home /home

# Or try NFSv4 specifically
mount -t nfs -o vers=4 nfs1.example.com:/var/nfs/home /home

Solution 2: Check for Invalid Options

Some options combinations can cause this error. Temporarily simplify:

mount -t nfs -o rw,hard,intr nfs1.example.com:/var/nfs/home /home

Solution 3: Validate Server Configuration

Check these server-side components:

# Verify exports
exportfs -v

# Check NFS services
systemctl status nfs-server rpcbind

When basic fixes fail, try these deeper diagnostics:

# Enable full debugging
mount -v -t nfs -o vers=3,debug nfs1.example.com:/var/nfs/home /home

# Capture network traffic (on separate terminal)
tcpdump -i eth0 port nfs -w nfs_debug.pcap

Here's a working server configuration for reference:

# /etc/exports
/var/nfs/home web1.example.com(rw,sync,no_subtree_check,no_root_squash)

# /etc/nfs.conf
[nfsd]
threads=8

[exportfs]
debug=all

For stable mounts, include these in /etc/fstab:

nfs1.example.com:/var/nfs/home  /home  nfs  rw,hard,intr,vers=3  0  0

I recently encountered the frustrating "mount.nfs: an incorrect mount option was specified" error while setting up NFS shares between CentOS 7.2 servers. The error appeared when executing:

mount -t nfs nfs1.example.com:/var/nfs/home /home

The error persisted even with basic troubleshooting:

  • Simplified /etc/exports configuration
  • Verified NFS service status
  • Checked firewall settings
  • Tried mounting from the NFS server itself

The verbose mount output revealed interesting details:

mount -v -t nfs nfs1.example.com:/var/nfs/home /home
mount.nfs: timeout set for Fri Jan 13 11:04:19 2017
mount.nfs: trying text-based options 'vers=4,addr=162.xxx.xxx.94,clientaddr=162.xxx.xxx.6'
mount.nfs: mount(2): Invalid argument
mount.nfs: an incorrect mount option was specified

After extensive testing, I discovered two potential causes:
1. Version compatibility issues between NFS client/server packages
2. SELinux context mismatches in the mount points

First, I recommend explicit version specification:

mount -t nfs -o vers=3 nfs1.example.com:/var/nfs/home /home

For systems needing NFSv4, try:

mount -t nfs4 -o proto=tcp,port=2049 nfs1.example.com:/var/nfs/home /home

If SELinux is the culprit, either temporarily disable it:

setenforce 0

Or properly set contexts:

semanage fcontext -a -t nfs_t "/home(/.*)?"
restorecon -Rv /home

Ensure your /etc/exports contains proper permissions:

/var/nfs/home web1.example.com(rw,sync,no_root_squash,no_all_squash)

After modifying exports, always run:

exportfs -ra
systemctl restart nfs-server

For debugging purposes, try these additional options:

mount -v -t nfs -o rw,nolock,hard,intr,timeo=600,retrans=2 \
nfs1.example.com:/var/nfs/home /home