Thursday, August 04, 2011

Network Filesystem (NFS)


NFS  is normally known as network file system.

The Network File System (NFS) is a distributed file system that allows users to access files and directories of remote servers as if they were local  for that particular machine.

NFS is independent of machine types, operating systems, and network architectures through the use of remote procedure calls (RPC)


Before configuring the NFS  services , WE should be  aware of the daemons used for this .

List of   daemons  used in NFS

/usr/sbin/rpc.lockd            Processes lock requests through the RPC package.

/usr/sbin/rpc.statd             Provides crash-and-recovery functions for the locking services on NFS.

/usr/sbin/biod                     Sends the client's read and write requests to the server.
                                           The biod daemon is SRC controlled.

/usr/sbin/rpc.mountd          Answers requests from clients for file system mounts.
                                            The mountd daemon is SRC    controlled.

/usr/sbin/nfsd                      Starts the daemons that handle a client's request for file
                                            system operations. nfsd is SRC controlled.

 /usr/sbin/portmap               Maps RPC program numbers to Internet port numbers.
                                             portmap is  Controlled  by inetd subsystems.



Steps to configure The NFS  Server

step 1
                       
                  Check whether  the NFS services  are started  and are active

                    #lssrc -g nfs
                        
                         Check the status  in the output of the NFS daemons .
                         The mentioned 5 daemons should be  started on the servers  and clients.
                    
                     # lssrc -g nfs
                     Subsystem         Group            PID             Status
                      biod                  nfs                233612          active
                      rpc.statd           nfs                217216          active
                      rpc.lockd          nfs               184458           active
                      nfsd                  nfs                561390          active
                      rpc.mountd       nfs                569442          active
                
            if it is not active ,start the NFS subsystem

                    #startsrc -g nfs

Step 2-
              Check  that portmap services are running on both  client and server,if not start  it.
          
                     #lssrc -g  portmap
                to start  use
                      #startsrc -g portmap

Step 3:    check whether /etc/exports file exists  on the server.if not create this file or this can be done automatically by adding the NFS Exports through smity
              
                       #touch /etc/exports or  use the #smitty nfs

Step 4 -   Add the NFS shares  in /etc/exports  file. this can  be done manually or through #smitty nfs>add the directory as an NFS exports



/share        -public,sec=sys,rw


Step 5 : make the entry of the NFS client,s in the /etc/hosts file .


Configuring and exporting the filesystem on client machine.

Step 1 :  Verify that portmap deamon is running on the server and also the rpc.mountd deamon is running on the client machine.

Step 2 : Verify that NFS Server entry is present in the /etc/hosts file of client machine.
.
Step 3: use the command #showmount -e <NFS-Server IP >  to verify that the exported Filesystem is accessible or visvible to the respective client machine.

Step 4:  Create a directory on which you are going to mount .
            #mkdir /Test

Step 5:  Mount the   NFS filesystem using the below command.
           #mount <NFS-Server-IP or Hostname>:/test  /Test


 

No comments:

Post a Comment