mount.nfs: an incorrect mount option was specified

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
User avatar
audiodef
Watchman
Watchman
Posts: 6656
Joined: Wed Jul 06, 2005 1:02 pm
Location: The soundosphere
Contact:

mount.nfs: an incorrect mount option was specified

Post by audiodef »

I can't figure out why this is happening. I seem to have everything in place.

Code: Select all

Tchaikovsky audiodef # mount -t nfs 192.168.1.3:/data /home/audiodef/Beethoven
mount.nfs: an incorrect mount option was specified
nfs is running on both machines. /etc/exports exists on the host machine:

Code: Select all

/data 192.168.0.0/255.255.0.0(async,rw,no_subtree_check)
nfs is compiled into the kernel.

The exact same setup works the other way around between these two machines. I'm at a loss. 8O
eccerr0r
Watchman
Watchman
Posts: 10234
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:

Post by eccerr0r »

Subscribing to this thread. I ran into this issue too but at one point I came up with a workaround, but it didn't stick. Silly thing is that it was working fine before but after either a nfsd update or something (perhaps portmap/rpc.bind?) it broke.

It also could have had something to do with default nfs versions (v3 vs v4?) Need to look into this some more...
Intel Core i7 2700K/Radeon Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
User avatar
krinn
Watchman
Watchman
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

Post by krinn »

You need to force nfsv3 to mount it with -o nfsvers=3,vers=3
the -t nfs was for nfsv3 and 2 and -t nfs4 for nfsv4, but now -t nfs == nfsv4 per default.

If you use a nfsv4 server (as it's the default now), then your mount point should have a root (define by fsid=0) and your mount point attach to it.

And the root mount point will be name /
So if /data is export as nfsv4 then your mount point is / and not /data

Here's my config, this might help you better seeing one working, note that /export/distfiles is use with version 3 while other use version 4

Code: Select all

# /etc/exports: NFS file systems being exported.  See exports(5).
/export 192.168.0.0/24(rw,sec=sys,fsid=0,no_subtree_check,async,no_root_squash,nohide,anonuid=250,anongid=250)
/export/distfiles 192.168.0.0/24(rw,root_squash,no_subtree_check,nohide,anonuid=250,anongid=250,secure,nohide)
/export/kernel 192.168.0.0/24(rw,no_subtree_check,nohide)
/export/portageshare 192.168.0.0/24(rw,nohide,sync,all_squash,secure,no_subtree_check)
In nfsv3 you can mount it with server:/export/distfiles
In nfsv4 you can mount it with server:/distfiles (and /export is the nfs root that can be mount using server:/ )

and the fstab on the client

Code: Select all

faramir:/export/distfiles   /mnt/faramir/distfiles   nfs          rw,users,nfsvers=3,vers=3                0 0
faramir:/portageshare           /mnt/faramir/portageshare      nfs4       rw,users    0 0
and the mount result

Code: Select all

mount | grep faramir
faramir:/export/distfiles on /mnt/faramir/distfiles type nfs (rw,users,noexec,nosuid,nodev,nfsvers=3,vers=3,addr=192.168.0.6)
faramir:/portageshare on /mnt/faramir/portageshare type nfs4 (rw,users,noexec,nosuid,nodev,addr=192.168.0.6,clientaddr=192.168.0.4)
You can then try
v3: mount -t nfs 192.168.1.3:/data /home/audiodef/Beethoven -o nfsvers=3,vers=3
or
v4: mount -t nfs4 192.168.1.3:/ /home/audiodef/Beethoven

I hope it will help you guys.
Post Reply