Sunday, January 1, 2012

Setup a NFS server and client

HOWTO: Setup a NFS Server & Client
In this tutorial, outlines the steps involved in setting up a NFS server & client. Typically this will be used to mount shares on the network, could be user home directory when authenticating via LDAP or media server.

This guide assumes a Debian Server -hostname iNAS- is ready to be converted as a NFS server.

Setup NFS Server

1. Logon to iNAS using root
2. Install NFS server package
~# apt-get install nfs-kernel-server
3. Create shared directory
~# mkdir -p /share /share/pictures /share/music /share/movies
4. Export this directory on exports file, vi /etc/exports and add the following line
/media                *(rw,sync,no_subtree_check,no_root_squash)
5. Restart NFS Service
~# service nfs-kernel-server restart

Setup NFS Client


1. Install NFS client
~# apt-get install nfs-common
2. Add NFS mount on fstab; edit /etc/fstab and add following line
iNAS: /share           /media        nfs  defaults 0 0
3. Restart client machine to confirm auto-mount works or mount the /media directory
~# mount /media
4. Check if it worked using df command

No comments:

Post a Comment