Wednesday, 20 April 2011

how to configure NFS Server


NFS SERVER
NFS Package
package name:           nfs-utils
conf file:              /etc/exports
ports:
scripts:
daemon:

Installing NFS server
1 Install the nfs package(if not)                     #yum install nfs-utils -y
2 Configure nfs                                       #vim /etc/exports
                                                            /data 192.168.9.0/24(ro,sync)
                                                           
  Format                                                    /data      192.168.9.0/255.255.255.0(ro,sync)
                                                            /data 192.168.9.5(ro,sync)
                                                            /data .example.com(ro,sync)
                                                            /data station5.example.com(ro,sync)
                                                            /data @RHCE(ro,sync)
                                                            /data 192.168.9.5(ro,sync) 192.168.9.7(rw,sync)
                                                            /data 192.168.9.7(rw,sync) 192.168.9.0/24(ro,sync)

  Format syntax                                             directory_path    to_whom permission 

                                                            Directory_path:         ur nfs shared folder
                                                            to_whom:                *
                                                                                    192.168.8.202
                                                                                    192.168.8.0/24
                                                                                    .example.com
                                                                                    pc_1.example.com
                                                            permission
                                                                  general folder:      ro,sync/rw,sync
                                                                  home_folder:      rw,sync,no_root_squash

Configure boot-time startup                           #chkconfig nfs on
                                                      #chkconfig portmap on
                                                      #chkconfig nfslock on

Restart service                                       #service nfs restart
                                                      #service portmap restart
                                                      #service nfslock restart

Check nfs server                                      #showmount -e localhost
                                                      or
                                                      #exportfs -v                  [on same machine]
NFS Client
Check nfs share                                       #showmount -e nfs_server
Mount on /media/Server                                #mount -t nfs 192.168.8.254:/var/ftp/pub /media/Server
Accessing nfs_server                                  #ls /media/Server
To exit nfs server on client                          #umount /media/Server



No comments:

Post a Comment