Solaris NFSv4 client mount from a Linux Server:
Since there had been some confusion over a Solaris Client failing to mount from a Linux based server (there may be a couple of issues you may bump into) -- I thought i'd share some hints and things to look at..
First, of course, your mount may fail because the item you wish to mount has not been exported from the server; using showmount -e <server> will return a list of exports for that server, if the item is not listed then you should contact the server sysadmin for help (or export it yourself :) using the exportfs command with possible updates to the /etc/exports file)
You may see a permission denied message, and if you are using snv_22 to snv_24 bits that could be due to the client using a non-reserved port. A couple of things can be done to over come that problem;
- add the insecure keyword to the exports option line on the server (allowing requests from non-reserved ports)
/foop *(rw,nohide,insecure,no_root_squash,sync)
- revert the default behavior for the client to use reserved ports
see this to do that!
You may also see a problem with no such file or directory (ENOENT).
The linux NFS server implements the NFSv4 pseudo filesystem (pFS) as a separate namespace to that of the server, and hence NFSv2/v3 (since in v2/v3 we expose the servers native namespace). The root of the pFS namespace is designated in the exports file via the fsid=0 option.
So for example lets say you have some data that you'd like to share in the following directories:-
/export/proj; /export/archive; /export/www; /export/temp.
An example /etc/exports file might look like this :-
/export/proj *.dev.dot.com(rw,insecure,sync)
/export/archive *(ro,insecure,sync)
/export/www @www(rw,insecure,sync)
/export/temp *(rw,insecure,sync)
Mounting using NFSv3 our mount command would look like this :-
# mount -o vers=3 linux_server:/export/proj /proj
This will work fine for v2/v3 mounts but fail for NFSv4. The pFS is customizable by the sysadmin allowing the flexibility to present a different namespace; for our example we may choose to specify that the root for the pFS be /export; Adding the following line to /etc/exports will allow us to do that :-
/export *(rw,fsid=0,insecure,no_root_squash,sync)
In doing this we are now presenting the pFS namespace to NFSv4 Clients as :-
/proj
/archive
/www
/temp
and as such we will need to alter the mount command on the NFSv4 Client:
# mount -o vers=4 linux_server:/proj /proj
See Also:
Using NFSv4
Linux NFS Client
_____________________________
Technorati Tags: OpenSolaris Solaris nfs
[posted with ecto]
Posted by macrbg [NFS] ( October 20, 2005 12:51 PM ) Permalink | Comments[7]

Posted by Sam Pullara on December 04, 2005 at 10:04 PM CST #
i configured linux nfs v4 . i tried to mount a shared directory in solaris 10 client machine. i got the " <mount dir:Not owner> " .What is the solution for this problem?
Thanks and Regards
J.Manoharan,
09362930654
Posted by J.Manoharan on December 07, 2007 at 12:53 AM CST #
Crazy, I've been looking EVERYWHERE for this simple explanation. I've been trying to mount my NFS share on my Ubuntu machine to my Solaris with no luck. All I needed was the "-o vers=3" option when mounting. Now all I need to do is figure how to add it to the vfstab.
Posted by Ken on January 15, 2008 at 10:42 PM CST #
Ken, Depending on the version of solaris: onnv try "sharectl set -p client_maxvers=3 nfs" -- this will set the max NFS version we try to v3 (so you'd need to explicitly state vers=4 for NFSv4) -- In solaris 10 edit the /etc/default/nfs file.
hth. Robert.
Posted by robert on January 15, 2008 at 10:54 PM CST #
Thank you Robert for the prompt reply. Actually, after doing some more research (Google of course) I found what I needed. This is what my vstab entry looks like
klone:/media/share0 - /mnt/share0_klone nfs - yes rw,vers=3
Essentially I just added the vers=3 option and it worked like a charm. I'm taking a Sun Solaris 10 administration course (second part) right now so this is definitely a good learning experience.
-KenG
Posted by Ken on January 16, 2008 at 12:00 AM CST #
I have the reverse problem, it seems, and I have an extra step I need help with. My server is Solaris 10 with NFS v4 it's my Linux boxes that are clients, some using v3 and others v4. In addition, I have a firewall in between that makes things more complicated. This info sort of help, but I might need a little more. Redhat clients with v3 are giving me permissions issues and the v4 client won't even connect unless I open all the ports on the firewall because they seem to open random ports.
For Solaris NFS Server v4 to v4 Linux clients, is there a way to control the random ports usage and force it to use specific ports?
For Solaris NFS Server v4 to v3 Linux clients, will your above example for permission still work or do I need something different?
Posted by AJ on May 24, 2008 at 10:03 AM CDT #
Thank you, this blogs had the exact answer I needed.
Posted by Jesus on July 08, 2009 at 03:38 PM CDT #