Mounting a directory from one server to another using NFS

MOUNT ServerA to ServerB

 

Step 1. Check the following service if running in both server

A. Check if nfs daemon is up using command

a. rpcinfo -p or

b. service nfs status

B. Check portmapping

a. service portmap status

C. If both services is down run the following below to start or restart

a. service nfs start or service nfs restart

b. service portmap start or service portmap restart

 

Step 2. Share ServerA directory

A. Export the directory from ServerA

a. Edit /etc/exports

vi /etc/exports

b. Add the line

/home/jdante/ 192.168.0.2(rw,sync,,no_root_squash)

Info.

Add the directory you want to export or share,add the IP address of ServerB and the option see below:

|—directory—-| |-ServerB-| |———–Option———–|

/home/jdante/ 192.168.0.2(rw,sync,,no_root_squash)

B. Run command below to update the nfs server.

exportfs -avr

Step 3. Mount the directory to ServerB

A. Edit the fstab

a. vi /etc/fstab

b. Add the line

192.168.0.1:/home/jdante/ /home/jdante2/ nfs hard,intr 0 0

Info.

Add ServerA IP address and directory, add the ServerB directory, type and option see below:

|—–ServerA——————| |—ServerB—-| Type|—Option–|

192.168.0.1:/home/jdante/ /home/jdante2/ nfs hard,intr 0 0

C. To activate the mount just type command below and press enter

mount -t nfs -a

 

Step 4. Check if properly mounted

A. Run command below to see status of mounted file

df -h

Advertisements

Mag-iwan ng Tugon

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Baguhin )

Twitter picture

You are commenting using your Twitter account. Log Out / Baguhin )

Facebook photo

You are commenting using your Facebook account. Log Out / Baguhin )

Google+ photo

You are commenting using your Google+ account. Log Out / Baguhin )

Connecting to %s