How to mount dir via NFS

Hi, for mount dir from another server you have to use NFS service
NFS - Network File System
First we need to install nfs service on both servers.
logon to your server with root user, and run:

# yum install nfs-utils nfs-utils-lib nfs-utils-lib-devel

After installation finished we need to tell the client machine (the one with the existing folder) that we want to share a folder.
edit /etc/exports like this:

# vi /etc/exports
and add the next line:
/the/folder/you/want *(rw,no_root_squash,async)

Now you need to be shore the NFS ports are open on your server: 2049/tcp 2049/udp and 111/tcp 111/udp

After everything done you can start the NFS service on both machines by:

#/etc/init.d/nfs start

Now you can mount your dir via NFS but first you need to open a folder to the mount one, by:

# mkdir /mnt/DIR
# mount servername:/the/folder/you/want /nmt/DIR

that's it, you done.

If you want the mount to be permanently (mount automatic when restart), you can do it by edit fstab file
and add it the next line:

# vi /etc/fstab
/servername:/the/folder/you/want /mnt/DIR nfs defaults 0 0
# mount -a


ENJOY.
Read more >>