2016-11-02T20:35:11
Setting Up an NFS Server
Server
Install NFS server components:
# apt-get install nfs-kernel-server portmap
Add the "root" of all shares (if this is your only share, this should be all you need):
# echo "/home 192.168.1.0/24(ro,fsid=0)" >> /etc/exports
Add additional shares:
# echo "/home/joe 192.168.1.0/24(rw,sync,no_subtree_check)" >> /etc/exports
Update NFS exports table:
# exportfs -avr
Restart NFS server:
# service nfs-kernel-server restart
Don't forget to allow NFS through iptables.
Client
# apt-get install nfs-common
# mount server:/share /share
Prosit!
Notes
Slow initial directory listing is caused by aliases (specifically color output). Explanation here: http://www.novell.com/support/kb/doc.php?id=7005969. Use \ls -la instead of ll as a workaround.
Sources:
https://wiki.debian.org/NFS
https://help.ubuntu.com/community/SettingUpNFSHowTo
https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-nfs-server-config-exports.html
http://www.tldp.org/HOWTO/NFS-HOWTO/intro.html
http://nfs.sourceforge.net/nfs-howto/ar01s07.html