Mount shared drive between two machine with NFS

Scenario:

If you have machine A and machine B, now you want drive /share of machine A to be shared with machine B.

Steps:

Assuming both machines are ubuntu.

a) machine A

1) Put the following lines in /etc/exports

/share *(rw,sync,no_root_squash,no_subtree_check)

2) Install nfs-kernel-server with-

# apt-get install nfs-kernel-server
# cd /etc/inid.d/
# ./nfs-kernel-server restart

b) machine B:

1) Put the following lines in /etc/fstab

hostname_of_machine_A:/share /share nfs defaults 0 0

Note that- hostname of machine A should be resolvable, put entry in /etc/hosts.

2) Install nfs-common

# apt-get install nfs-common
# mkdir /share
# mount -a

Done.

Advertisements

Leave a Reply

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 / Change )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s