Archive for 2010 年 08 月

NFS Server setup

八月 4, 2010

NFS Server

Installation:

$> sudo apt-get install portmap nfs-kernel-server

Setting:

edit /etc/exports, and export shares by $> sudo exportfs -ra Restarting Services

$> sudo /etc/init.d/portmap restart
$> sudo /etc/init.d/nfs-kernel-server restart
note 1: you can checkout nfs daemon log by cat /var/log/syslog to see what is going on.
note 2: if you keep getting "refused mount request from xxxx for xxx: illegal port xxxxx", add insecure option to nfs share in /etc/exports
$> showmount localhost -e

NFS Client

Installation:

$> sudo apt-get install portmap nfs-common

Setting:

Add the following line to /etc/hosts.deny
portmap : ALL
add the following line to /etc/hosts.allow: //serverip = 192.168.1.250
portmap : 192.168.1.254
mount nfs shares
$ > mount -t nfs 192.168.1.254:/path/to/shares /local/path
if you want to mount nfs share on boot, adding mount option to /etc/fstab
192.168.1.254:/path/to/shares /local/path nfs rw,hard,intr 0 0