Thursday, April 24, 2014

Ubuntu - How to Set Up NFS Mount

This tutorial explains how to set up an NFS server on Ubuntu 12.04. NFS stands for Network File System; through NFS, a client can access (read, write) a remote share on an NFS server as if it was on the local hard disk.

For CentOS version, please check out this page: (http://tonylixu.blogspot.ca/2014/03/how-to-install-and-configure-nfs-on.html)

Server side:
Install required software:
If you don't have nfs and portmap package installed, install it now:
# apt-get install nfs-kernel-server portmap

Export the shared directory:
Assume the directory you want to share is "/home/lxu", then this chosen directory should be added to /etc/exports file,
# vi /etc/exports
add
/home/lxu      10.10.10.*(rw,root_squash,no_subtree_check)
# Export directoy:
# exportfs -a
# Verify the exported directories
# exportfs
/home/lxu  10.10.10.*

Permission:
By default Ubuntu use "nobody:nogroup" for nfs client mounting. You can confirm it in "/etc/idmapd.conf" file. Let's chown the directory:
# chown nobody:nogroup /home/lxu

Client setup:
Since all my nfs clients are CentOS, you can just follow the link here for client side setup:
http://tonylixu.blogspot.ca/2014/03/how-to-install-and-configure-nfs-on.html

No comments: