Penguin
Note: You are viewing an old revision of this page. View the current version.

Useful NFS goodness

NFS Hangs when the server goes away

By default NFS will hang until the server responds, ignoring signals. If the server comes back everything should resume and pick up where it left off. If you want to change this behaviour we recommend using 'hard,intr' in fstab(5), eg
server:/mount /mountpoint nfs intr,hard 0 0

the 'hard' means 'never give up' (you can use 'soft' here, but it's not a good idea, the server tends to time it out too quickly. you might want to look at timeo= to set this timeout up, but hard is probably wiser)

the 'intr' means 'allow signals to interrupt this process'. ie: if the process has 'hung' waiting on the nfs server, you can still kill it (if for instance you wanted to umount(8) the now broken nfs mount)

I exported stuff and NFS isn't allowing it to mount!

You probably forgot to run exportfs(8)? after updating exports(5). Silly you.

I can't mount stuff!

Did you remove rpc.statd(8), portmap(8) or other critical SUN RPC stuff? :)

"When setting up IPTABLES firewalling for Linux systems running the NFS service (network file system), you hit the problem that some of the TCP/IP and UDP ports used by components of the service are randomly generated as part of the SunRPC mechanism. This HOWTO document is part of the LinWiz? tool kit, and describes how to set up NFS on your server in such a way that meaningful IPTABLES firewall rules can be applied to the system."

Where did portmap go?

If you are setting up nfs on FreeBSD 5.0 or later and wonder where the portmap utility went, it has been renamed rpcbind.

I'm mounting an export, and files are created as "nobody"

Try adding the no_all_squash option to the export in question in /etc/exports. Note, your uid/gids should be the same on the two boxes.