Setup and Configure NFS Mounts on Linux Server
-----------------------------------------------
To setup NFS mounts, we’ll be needing at least two Linux/Unix machines.
Here in this tutorial, I’ll be using two servers
NFS Server: host.cloudtectiq.com IP-104.194.238.153
NFS Client: host.cloudtectiq1.com IP-104.194.238.152
Installing NFS Server and NFS Client
We need to install NFS packages on our NFS Server as well as on NFS Client machine.
We can install it via “yum” (Red Hat Linux) and “apt-get” (Debian and Ubuntu) package installers.
Command for redhat/centos server
#yum install nfs-utils nfs-utils-lib
#yum install portmap (not required with NFSv4)
Command for ubuntu server
#apt-get install nfs-utils nfs-utils-lib
Now start the services on both machines
#/etc/init.d/nfs start
#/etc/init.d/rpcbind start
#chkconfig --level 35 nfs on
#chkconfig --level 35 rpcbind on
First we will be configuring the NFS server.
------------------------------------------------
#mkdir /nfsshare
#vi /etc/exports
entry is file is like "/nfsshare 104.194.238.152(rw,sync,no_root_squash)"
Setting Up the NFS Client
------------------------------
#showmount -e 104.194.238.153
Display message is
Export list for 104.194.238.153:
/nfsshare 104.194.238.153
Mount Shared NFS Directory
---------------------------------
#mount -t nfs 104.194.238.153:/nfsshare /mnt/nfsshare
For permannent mount
#vi /etc/fstab
104.194.238.153:/nfsshare /mnt/nfsshare nfs defaults 0 0
#mount -a
Done
Note: First disable iptables
By Gaurav Sharma
Thanks !