Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]

Search This Blog

Saturday, September 12, 2015

Create a new local NFS mount


Below I will creating a new NFS file system named /nfs


[oracle@collabn1 ~]$ df -Ph
Filesystem                       Size  Used Avail Use% Mounted on
/dev/mapper/vg_collabn1-lv_root   31G   20G   11G  66% /
tmpfs                            1.8G  758M  1.1G  43% /dev/shm
/dev/sda1                        477M   66M  382M  15% /boot
stage                            465G  280G  186G  61% /media/sf_stage
/dev/asm/shared-162              1.0G   79M  946M   8% /shared


[root@collabn1 ~]# cd /


[root@collabn1 /]# mkdir localfs nfs


Add the below lines in the fstab

[root@collabn1 ~]# vi /etc/fstab

# create an NFS mount on nfs which points back to localfs
localhost:/localfs /nfs nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,noac

Add the below line to the exports file

[root@collabn1 ~]# cat /etc/exports
/nfs *(rw,no_root_squash,sync)

stop/start the nfs service:

[root@collabn1 /]# chkconfig nfs on

[root@collabn1 /]# service nfs stop
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
Shutting down RPC idmapd:                                  [  OK  ]

[root@collabn1 /]# service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]


[root@collabn1 /]# mount /nfs

[root@collabn1 /]# df -Ph
Filesystem                       Size  Used Avail Use% Mounted on
/dev/mapper/vg_collabn1-lv_root   31G   20G   11G  66% /
tmpfs                            1.8G  758M  1.1G  43% /dev/shm
/dev/sda1                        477M   66M  382M  15% /boot
stage                            465G  280G  186G  61% /media/sf_stage
/dev/asm/shared-162              1.0G   79M  946M   8% /shared
localhost:/localfs                31G   20G   11G  66% /nfs

huray….. /nfs is mounted and available for use.

 [root@collabn1 /]# ls -ld /nfs
drwxr-xr-x 2 root root 4096 Sep 12 18:49 /nfs
 
[root@collabn1 /]# chown oracle:dba /nfs
 
[root@collabn1 /]# ls -ld /nfs
drwxr-xr-x 2 oracle dba 4096 Sep 12 18:49 /nfs


[oracle@collabn1 nfs]$ pwd
/nfs
 
[oracle@collabn1 nfs]$ mkdir test
 
[oracle@collabn1 nfs]$ ls -lrt
total 4
drwxr-xr-x 2 oracle oinstall 4096 Sep 12 18:59 test

 

No comments: