Monday, August 27, 2012

Mount a linux server dir to another linux server directory

Say we have 2 servers named as
server1                 (
server2                 (192.168.1170)

we want to mount a directory of on the .170 server

install nfs server on server1 (.45)
#yum install nfs-utils nfs4-acl-tools portmap
#chkconfig nfs on

Share the directory on server1(.45)
#vim /etc/exports
save the file {it will give server2 (.170) read write access}
# exportfs -avr

Mounting the /image1 directory on the server2
you need to create a directory on server2 where you want to mount the directory from server1
#mkdir /image1

#vim /etc/fstab     /image1 nfs hard,intr 0 0
save and close the  file

#mount -t nfs -a

the above command will mount the server1 shared directory to the server2 directory(/image1).

No comments:

Post a Comment