NETWORK FILE SHARING (NFS)
NFS (Network File Sharing):
The Network File System (NFS) is a distributed file system that allows users to access files and directories of remote servers as though they were local. For example, you can use operating systems commands to create, remove, read, write, and set file attributes for remote files and directories. NFS is independent of machine types, operating systems, and network architectures because of its use of remote procedure calls (RPC) for these services.
For the successful implementation of an NFS environment, you need the following things:
1. The NFS daemons should be running on the server and the clients.
2. The file systems that need to be remotely available will have to be exported.
3. The exported file systems need to be mounted on the remote (client) systems.
NFS provides its services through a client-server relationship.
The following are a list of terms that are used throughout this discussion:
Server: A computer that makes its file systems, directories, and other resources available for remote access.
Clients: The computers, or their processes, that use a server’s resources.
Export: The act of making file systems available to remote clients.
Mount: The act a client needs to do to access the fil
IP Address: It may be IPv4 /IPv6
NFSd is the daemon which is required for the NFS and NIS (network Information service ) for work NFSd. When we install an NFS package both NFSd and NIS will install. Before all this your tcpip daemon must be up.
Now things which you have to check before exporting file system. Exporting a file system means sharing a file system.
1.Check NFS Services or NFSd daemon is running or not.
lssrc -g NFS ( g is for group) it will list all the NFS groups daemon.
Subsystem Group PID Status
biod NFS 15740 active
NFSd NFS 11376 active
rpc.mountd NFS 5614 active
rpc.statd NFS 16772 active
rpc.lockd NFS 15496 active
so for NFS to work successfully,the above listed 5 daemons,biod,NFSd,rpc.mountd,rpc.statd,rpc.lockd must be running.
If these daemons are not running,then you need to strart the daemos using the command
#strartsrc -g NFS
Check NFS packge is install or not.
NIS is install when you install NFS package
lslpp –l |grep –i NFS (It list the lpp means package installed)
If bos.net.NFS.client is listed means that your NFS package is install.
The other things which may need are
Rpc means remote procedure call it check whether rpc is working or not your NFS port is running etc.
If your rpc is not working then check rpcinfo <hostname> mean check for your hostname if not then check for rpcinfo <IP address>.
If rpcinfo is working with IP address and not working with hostname means that it is not resolving the name.But if this is a self system and we are giving the IP of system itself then it indicate that we have missing the entry in /etc/host.
We have to add the entry in /etc/hosts.
- Ping should work & we need to ensure that ping should be working with hostname i.e means hostname getting resolved if not but ping with IP address means correct the entry in /etc/hosts.
Export the file system: smit mkNFS is the fast path for NFS
For sharing a file there is one server and on client.
Server –The machine from where you are sharing
Client – The machine on which you are exporting the fileIn server machine :
- vi /etc/export
showmount –e (show all the exported file system)
- export the file by smitty
smit NFS OR smit mkNFSexp
In client machine :
mount -o soft prd1lp1prd:oracle-cds /oracle