filesystem | nfs

NFS setup


Server settings


1. install programs:

sudo apt-get install nfs-kernel-server nfs-common portmap


2. edit /etc/exports

sudo nano /etc/exports

add client adresses:
/mnt/herschel/ 192.168.1.20(rw,sync,no_subtree_check)
/mnt/herschel/ 192.168.1.21(rw,sync,no_subtree_check)
/mnt/herschel/ 192.168.1.22(rw,sync,no_subtree_check)
/mnt/herschel/ 192.168.1.23(rw,sync,no_subtree_check)
/mnt/herschel/ 192.168.1.24(rw,sync,no_subtree_check)
/mnt/herschel/ 192.168.1.25(rw,sync,no_subtree_check)
/mnt/herschel/ 192.168.1.88(rw,sync,no_subtree_check)
/mnt/herschel/ 192.168.1.36(rw,sync,no_subtree_check)
/mnt/herschel/ 192.168.1.37(rw,sync,no_subtree_check)
/mnt/zermelo/ 192.168.1.20(rw,sync,no_subtree_check)
/mnt/zermelo/ 192.168.1.21(rw,sync,no_subtree_check)
/mnt/zermelo/ 192.168.1.22(rw,sync,no_subtree_check)
/mnt/zermelo/ 192.168.1.23(rw,sync,no_subtree_check)
/mnt/zermelo/ 192.168.1.24(rw,sync,no_subtree_check)
/mnt/zermelo/ 192.168.1.25(rw,sync,no_subtree_check)
/mnt/zermelo/ 192.168.1.88(rw,sync,no_subtree_check)
/mnt/zermelo/ 192.168.1.36(rw,sync,no_subtree_check)
/mnt/zermelo/ 192.168.1.37(rw,sync,no_subtree_check)
/mnt/newton/ 192.168.1.20(rw,sync,no_subtree_check)
/mnt/newton/ 192.168.1.21(rw,sync,no_subtree_check)
/mnt/newton/ 192.168.1.22(rw,sync,no_subtree_check)
/mnt/newton/ 192.168.1.23(rw,sync,no_subtree_check)
/mnt/newton/ 192.168.1.24(rw,sync,no_subtree_check)
/mnt/newton/ 192.168.1.25(rw,sync,no_subtree_check)
/mnt/newton/ 192.168.1.88(rw,sync,no_subtree_check)
/mnt/newton/ 192.168.1.36(rw,sync,no_subtree_check)
/mnt/newton/ 192.168.1.37(rw,sync,no_subtree_check)
/mnt/tarski/ 192.168.1.20(rw,sync,no_subtree_check)
/mnt/tarski/ 192.168.1.21(rw,sync,no_subtree_check)
/mnt/tarski/ 192.168.1.22(rw,sync,no_subtree_check)
/mnt/tarski/ 192.168.1.23(rw,sync,no_subtree_check)
/mnt/tarski/ 192.168.1.24(rw,sync,no_subtree_check)
/mnt/tarski/ 192.168.1.25(rw,sync,no_subtree_check)
/mnt/tarski/ 192.168.1.88(rw,sync,no_subtree_check)
/mnt/tarski/ 192.168.1.36(rw,sync,no_subtree_check)
/mnt/tarski/ 192.168.1.37(rw,sync,no_subtree_check)
/mnt/pasteur/ 192.168.1.20(rw,sync,no_subtree_check)
/mnt/pasteur/ 192.168.1.21(rw,sync,no_subtree_check)
/mnt/pasteur/ 192.168.1.22(rw,sync,no_subtree_check)
/mnt/pasteur/ 192.168.1.23(rw,sync,no_subtree_check)
/mnt/pasteur/ 192.168.1.24(rw,sync,no_subtree_check)
/mnt/pasteur/ 192.168.1.25(rw,sync,no_subtree_check)
/mnt/pasteur/ 192.168.1.88(rw,sync,no_subtree_check)
/mnt/pasteur/ 192.168.1.36(rw,sync,no_subtree_check)
/mnt/pasteur/ 192.168.1.37(rw,sync,no_subtree_check)


3. Edit /etc/hosts.allow

sudo nano /etc/hosts.allow

and add client adresses:
portmap: 192.168.1.20 , 198.168.1.21 , 198.168.1.22 , 198.168.1.23 , 198.168.1.24 , 198.168.1.25 , 198.168.1.88 , 192.168.1.36 , 192.168.1.27
sshd: 192.168.1.20/192.168.1.99
restart computer.


4. If the command

sudo /etc/init.d/nfs-kernel-server restart

gives the output

[warn] Not starting: portmapper is not running ... (warning).

then do:

sudo update-rc.d rpcbind enable && sudo update-rc.d nfs-common enable

sudo /etc/init.d/nfs-kernel-server restart

Installation is finished.


If there is a problem try:

sudo service rpcbind start


5. If you run 'rpcinfo -p' from the server, as you should see a largish list of information, including 'nfs' and 'portmapper' as some of the lines.

Client settings


1. install programs:

sudo apt-get install nfs-common


2. mount:

sudo mount 192.168.1.33:/example /mnt/localmountpoint


3. unmount commands. (the second one forces it.)

sudo umount /mnt/localmountpoint

sudo umount -f -l /mnt/localmountpoint


add alias in bashrc if you want:

alias fardisk='sudo mount 192.168.1.33:/mnt/itachi /mnt/localmountpoint'

alias ufardisk='sudo umount -f -l /mnt/localmountpoint'