Mar 262011
 

Sometimes I’ve had to make files available to other hosts, either for transfers or temporary space, and NFS is the quickest way to do it. Problem is, I do this so rarely I can never remember the bare essentials. Here’s what you need to set up NFS as quickly as possible with scant regard for security or performance.

So, in this example we’ll share /home/user/public from server “filer” to /mnt on “enduser”.

NFS Server

     # echo "/home/user/public enduser(rw,sync)"  >> /etc/exports
     # service portmap start
     # service nfs start
     # service iptables stop    (or open TCP/111, and probably some others)

NFS Client

     # service portmap start
     # mount -o rw filer:/tmp/public /mnt

And that’s it – NFS in as few keystrokes as possible. If you want to do it properly, you’d be better off looking elsewhere, but you’ll need to edit /etc/exports on the NFS server, set security there and in /etc/hosts.allow, and also edit /etc/fstab on the client. There’s a whole bunch of performance related options you can put in there.


Matt Parsons is a freelance Linux specialist who has designed, built and supported Unix and Linux systems in the finance, telecommunications and media industries.

He lives and works in London.