Saturday, January 25, 2014

NFS MOUNTING

TO CONFIGURE NFS SERVER

1.  mkdir   /share           ->create a dir under  /  which you want to share.
2.  chmod a+w /share         ->Allow all to write to the /share dir
3. vim /etc/exports          ->write entries of that share in this file
a. /abc  *(rw,sync)                                      //All Domain

b. /abc  *.example.com(rw,sync)                        
   /abc  *.matrix.com(rw,sync)                           //Two Domains

c. /abc   *.example.com(rw,sync)                        //Only Example domain

d. /abc   192.168.0.82(rw,sync)                          //Single Machine

e. /abc   192.168.0.82(rw,sync)  192.168.0.42(rw,sync)   //Double Machine

f. /abc   192.168.0.1-10(rw,sync)                         //Range of ips


g. /abc            192.168.0.0/24(ro,sync)       //Read-Only file,cant create   file,after mounting

h. /abc          *(rw,sync,no_root_squash)    //When client creates file  under /share dir, it gets created under roots name

4. service portmap restart
5. service nfs restart
6. rpcinfo -p              ->Shows random port num

NFS CLIENT

showmount -e 192.168.0.38  -->shows dir shared by remote/server

1. TEMPORARY MOUNTING
mount 192.168.0.38:/songs /media
cd /media/
ls
mount
cd
umount /media

2. PERMANENT MOUNTING

->vim /etc/fstab
  192.168.0.38:/songs   /media     nfs    defaults       1 2
->mount -a
->mount



No comments:

Post a Comment