Thursday, 26 March 2015

NFS server [ linux to linux file sharing ] Port : 2049



3 type of storage
1> DAS ( Direct Attach Storage ) => HDD
2> NAS ( Network Attach Storage ) => NFS, Samba
3> SAN ( Storage Area Network ) => ISCSI, fibreoptic
=================================================


NFS server [ linux to linux file sharing ] Port : 2049
NFS allows a system to share direcotries and files with other machines over a network. By using this user and program can access files on remote system.

eg. share the direcotry /data [ 192.168.0.130] to 192.168.0.2
=================================================
Syntax of /etc/exports file

/path/directory   IP_address op1,op2

op1,2 => rw, ro, sync, async
=================================================
Export command option
#exportfs
a : export / unexport all directores
r : re-export all directories
u : unexport one/more directories
v : be verbose when exporting / unexporting
================================================

server side

1> #yum install nfs-utils

2> create directories to sharing
#mkdir /data
#cd /data
#touch file1 file2 file3

3>vim /etc/exports
/data 192.168.0.2 (rw,sync)

:wq

4>#service nfs restart

5>#chkconfig nfs on

6>re-export all the share content
#exportfs -arv

7>to check all the export data/list
#exportfs

8>to unexports all the sharing
#exportfs -au

=====================================================

client side

1> access shared directory
#cd /net/192.168.0.130 => #cd /net/serverIPaddress => it automatically mount during this command

#cd ls
#cd /data

OR
you can mount the shared directories where you want
#mount -t /nfs 192.168.0.130:/data  /mnt

========================================================

Extra

1> umount the directories
#umount -t nfs /mnt

2>umount all the shared directories
#umount -at nfs

3>permanant mounting
#vim /etc/fstab

192.168.0.130:/data     /mnt nfs defaults 0 0

:wq

#mount -a

Note : rechek using "#df -hT"

=======================================================

 

No comments:

Post a Comment