NFS Sharing

From Server Side:

1- check if NFS server is installed and running:

Check package availability:

# rpm -qa | grep nfs
nfs-utils-lib-1.0.8-7.9.el5
nfs-utils-1.0.9-71.el5_11
nfs4-acl-tools-0.3.3-3.el5
system-config-nfs-1.3.23-2.el5

If no output, then install the package:

# yum install nfs-utils nfs4-acl-tools

Verify service status:

# service nfs status

rpc.mountd (pid 9382) is running…
nfsd (pid 9379 9378 9377 9376 9375 9374 9373 9372) is running…
rpc.rquotad (pid 9308) is running…

if no output, then start the service:

# service nfs start

2- Configuration files:

Main Config file:

/etc/exports                     Contain list of resource will be exported to clients.

Additonal Files:

/etc/sysconfig/nfs         Contain the main config for NFS Service.

/var/lib/nfs/etab           List of currently exported reources.

/var/lib/nfs/rmtab        List of remotely mounted resources.

Adding locations and permission to /etc/exports:

file syntax  <mountpoint> <host><permissions/options>

exmaple :

#vi /etc/exports

/home/sharefolder    *(rw,sync)        note: there in no space between host and permissions.

* :mean allow all host to mount this resource.

rw  :set read/write permissions to folder.

sync :All changes must be written to disk.

 

3- Reexports all directory:

#exportfs -arv

or

# service nfs restart

 

From Client Side:

4- check rpcbind service is up and running.

5- create local directory :

# mkdir /home/shared_from_remote_server

6- mount NFS share:

Check available shared on remote server:

# showmount -e 172.16.1.1
Export list for 172.16.1.1:
/home/sharefolder    *

Mount the sharefolder NFS share:

# mount -t nfs  172.16.1.1:/home/sharefolder    /home/shared_from_remote_server

7- add entry to /etc/fstab to have them mounted automatically at system boot

# vi /etc/fstab

172.16.1.1:/home/sharefolder      /home/shared_from_remote_server   nfs       rw,sync    0  0

To verify correct added line to /etc/fstab:

#umount  /home/shared_from_remote_server

# mount -a

if no error message appear its mean your syntax is correct.

8- Verify that the resources was mounted properly :

# mount | grep nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
172.16.1.1:/home/sharefolder on /home/shared_from_remote_server type nfs (rw,addr=172.16.1.1)

9-  enable nfs service at boot time:

# chkconfig nfs on

 

Examples:

#mount -t nfs -o rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 172.16.16.205:/share01 /u02

Use this option if you were cloning Oracle Products to nfs share folder.

#mount -t nfs 10.32.209.133:/app1/TEST/inst/apps/TEST2_terbdb2/logs/appl/conc/out /terdb2

#mount -t nfs 10.32.209.132:/app1/TEST/inst/apps/TEST1_terbdb1/logs/appl/conc/out /terdb1

 

 

#mount -t nfs -o rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 172.16.16.205:/share01 /rman

 

 #mount
10.32.209.132:/app1/TEST/inst/apps/TEST1_terbdb1/logs/appl/conc/out on /terdb1 type nfs (rw,addr=10.32.209.132)
10.32.209.133:/app1/TEST/inst/apps/TEST2_terbdb2/logs/appl/conc/out on /terdb2 type nfs (rw,addr=10.32.209.133

)

Leave a Reply

Your email address will not be published. Required fields are marked *

8 + 8 =