Tuesday, October 24, 2006

NFS sever on Ubuntu 5.10

To setup nfs server on you Ubuntu, few steps are required.

  1. Install packages sudo apt-get install portmap nfs-common nfs-kernel-server
  2. Create, if not exists, file: /etc/exports where you indicate folders you want to share. For example I have in my exports (IP addresses have been change):
    /home/me/mynfs 196.17.227.221/255.255.255.0(rw,sync,all_squash)
    The above means I want to export the /home/me/mynfs directory to computer 196.17.227.221 with the options "read&write" &"sync"&"all_squash".
  3. Start/restart you nfs server: /etc/init.d/nfs-kernel-server start
That should works. To check if you are really exporting something you can use:

showmount -e localhost

and if you see:

Export list for localhost:
/home/mwolski/mynfs
196.17.227.221/255.255.255.0

it means it work. However, there can be little problem caused by firewall. I had to enable all connection to port 2041, to allow external users to connect to my share. To chack if you can mount this share from other computer, just run showmount -e IP_OF_NFS_server.

To run NFS server it is enought.

Later I will descripe how to mount nfs share and also I try to figure out all those nfs options, you can put to /etc/exports.