The Network File System protocol (NFS) is used when disks need to be shared between Linux servers. Basic configuration is fairly simple, and this chapter will explain all the essential steps.
You should follow some general rules when configuring NFS.
1. Only export directories beneath the / directory.
2. Do not export a subdirectory of a directory that has already been exported. The exception being when the subdirectory is on a different physical device. Likewise, do not export the parent of a subdirectory unless it is on a separate device.
3. Only export local filesystems.
Install package of NFS
1. Check package of NFS
[root@localhost ~]# rpm -qa|grep nfs
2. Example we create folder "software" in folder "mnt" and create file in folder "software"
- Create folder software
[root@localhost ~]# cd /mnt
[root@localhost mnt]# mkdir software
- Create files
[root@localhost mnt]# cd /software
[root@localhost software]# touch test1
3. Edit exports files
[root@localhost ~]# vi /etc/exports
It will show dialog
- /mnt/software: is directory of folder that we want to share.
- 192.168.100.111/255.255.255.0: is IP address of machine that we want to share.
4. Restart service NFS
[root@localhost ~]# service nfs restart
5. Export folder that shared to network
[root@localhost ~]# exportfs –a
- Show information shared
[root@localhost ~]# exportfs
6. Mount or Map drive: To get folder shared from server to store in client
[root@localhost ~]# mount -t nfs 192.168.100.100:/mnt/software /mnt/test
- 192.168.100.100 : is IP address of server that shared folder
- /mnt/software : is directory of folder shared from server
- /mnt/test : is directory of folder on client for store file shared from server
7. Open File Browser and browse to folder "mnt" we will see result
open folder test
Complete configuring NFS.
No comments:
Post a Comment