In this example, the client is 10.10.0.3 and the server is 10.10.0.1. The folder to be shared is
/home/sharing, and to be mounted to /mnt on the client
On the server
1: make this diretory :
[root@amir ~]# mkdir /home/sharing
2:Edit /etc/exports, insert the client computer ip
vi /etc/exports
and add this line:
/home/sharing 10.10.0.3/255.255.255.255(rw,sync)
save and exit
3: Edit /etc/hosts.allow
vi /etc/hosts.allow
add : portmap: 10.10.0.0/255.255.255.0
save and exit.
4: start nfsand portmap :
[root@amir ~]# /etc/init.d /nfs start
[root@amir ~]# /etc/init.d /portmap start
On the client
start
/etc/init.d/portmap start
Mount the nfs folder
mount 10.10.0.1:/home/sharing /mnt
Check /var/log/messages for any error that might occur
tailf /var/log/messages
Use mount to check if the folder is mounted properly
the output should be like :
10.10.0.1:/home/sharing on /mnt type nfs (rw,addr=10.10.0.1)
Edit /etc/fstab to mount the shared folder on boot :
vi /etc/fstab
add
10.10.0.1:/home/sharing mnt nfs rw,hard,intr 0 0
save and exit .
No comments:
Post a Comment