To share the Files across the Linux machines we need to setup the NFS share.
NFS (Network File System) is a protocol used by UNIX/Linux computers to share disks across a network. Similar to the Common Internet File Services (CIFS) protocol used by Windows, NFS is older and more light-weight, and performs much more efficiently on UNIX and Linux systems.
Lets check the steps.
Step 1:
First, open /etc/exports as root and enter the folder you want to share. If this file doesn't exist you will need to create it.
#vi /etc/exports
Esc + i (use the Esc and i key to insert)
/folder_to_share *(rw) --- (These lines indicate folder to share with all giving read & write permission)
Esx + : + w + q + ! (use these combination key to save and exit)
Step 2 : now lets start the services
#/etc/init.d/nfs start
This script may have a slightly different name in your distribution that you need to figure it out but more or less it should resemble this name
So now we are done with the NFS server, this is were you have your share folder, Now lets see how we can mount this folder on the client and use the share files.
Step 3 :
login to the Clients , These can be any linux box where you want to access these files and give the following command.
# mount -t nfs IP_OF_NFS_SERVER:/SHARE_FOLDER /MOUNT_POINT_ON_YOUR_LOCAL_SYSTEM
eg: #mount -t nfs 192.168.1.100:/share /local
once the work of the share folder is completed. just execute the below command to unmount
#umount /mount_point_on_your_local_system.
eg: #umount /local
You are done...
Cheers,
All the Best ..... :)
No comments:
Post a Comment