Wednesday, December 3, 2008

NFS mount from Redhat Linux(NFSv3) to Solaris 10(NFSv4)

NFS mount from Redhat Linux(NFSv3) to Solaris 10(NFSv4)

On Linux
Edit /etc/exports
/home 11.12.13.414(rw) ->with partition and which server you want to mount to

The /etc/exports file controls which file systems are exported to remote hosts and specifies options

#exportfs -r
#service nfs start/reload/restart


On solaris side
#dfshares (linux server name) -> will list all shares from the linux server

Manually mount
#mount -F nfs -o vers=3 linuxservername:/home /data

Edit /etc/vfstab
servername:/home - /data nfs - yes soft,bg
-----------------------------------------------------------------------------------

Error:
mount: /data: Not owner
-bash-3.00# mount servername:/home /data
nfs mount: mount: /data: Not owner

Solution:
It is because you are trying to mount an nfsV3 share with an nfsV4 client.
This occurs when you want to share an nfs from a redhat linux host to a solaris 10 host.

Use the option vers=3 to avoid this problem or configure nfsV4 on the linux host.
#mount -F nfs -o vers=3 server:/data /mnt/nfs


Also, you should check /etc/default/nfs on the server side to see both client and server side are set to same version you are planning to implement.
NFS_SERVER_VERSMAX=3

Try not to mix nfs versions, and be consistent on version3 or version4

Currently, there are three versions of NFS. NFS version 2 (NFSv2) is older and is widely supported. NFS version 3 (NFSv3) has more features, including

variable size file handling and better error reporting, but is not fully compatible with NFSv2 clients. NFS version 4 (NFSv4) includes Kerberos security,

works through firewalls and on the Internet, no longer requires portmapper, supports ACLs, and utilizes stateful operations. Red Hat Enterprise Linux

supports NFSv2, NFSv3, and NFSv4 clients, and when mounting a file system via NFS, Red Hat Enterprise Linux uses NFSv4 by default, if the server supports it.

All versions of NFS can use Transmission Control Protocol (TCP) running over an IP network, with NFSv4 requiring it. NFSv2 and NFSv3 can use the User

Datagram Protocol (UDP) running over an IP network to provide a stateless network connection between the client and server.

When using NFSv2 or NFSv3 with UDP, the stateless UDP connection under normal conditions minimizes network traffic, as the NFS server sends the client a

cookie after the client is authorized to access the shared volume. This cookie is a random value stored on the server's side and is passed along with RPC

requests from the client. The NFS server can be restarted without affecting the clients and the cookie remains intact. However, because UDP is stateless, if

the server goes down unexpectedly, UDP clients continue to saturate the network with requests for the server. For this reason, TCP is the preferred protocol

when connecting to an NFS server.

When using NFSv4, a stateful connection is made, and Kerberos user and group authentication with various security levels is optionally available. NFSv4 has

no interaction with portmapper, rpc.mountd, rpc.lockd, and rpc.statd, since they have been rolled into the kernel. NFSv4 listens on the well known TCP port

2049.

Some useful commands:
---------------------
#nfsstat -a
#rpcinfo solaris-nfs-server

No comments: