When things go wrong with NFS

There are a couple of tools that can be used to specifically check NFS connections. Because NFS relies on the same mechanism as other programs using TCP/IP, solving NFS problems start with understanding the tools used for TCP/IP. Rather than repeating myself, I would point to the section on TCP/IP and the various HOWTOs.

If you want see all the programs using RPC on a specific machine, I would run it as:

rpcinfo -p <hostname>

Which might give me something like this:

programversprotoport 
1000002tcp111portmapper
1000002udp111portmapper
1000682udp1027cmsd
1000683udp1027cmsd
1000684udp1027cmsd
1000685udp1027cmsd
1000831tcp1028ttdbserver
1000051udp692mountd
1000051tcp694mountd
1000032udp2049nfs
1000032tcp2049nfs

The columns are:

Program-number version-number protocol port program

The program number is the RPC number of that program. You can see what RPC number equates to what program number by looking in /etc/rpc. Here we see that all the NFS related daemons are running. If we look carefully, we see that there for each program (except walld and rusersd) there is a copy of the program using both UDP and TCP. If you find that one or more of these is not running, then stopping and restarting NFS might work. Otherwise, rebooting should correct the problem. Note that portmapper, mountd, nfs, and status are required.

If you want to check if a particular program is running on the server, this can also be done with rpcinfo. The general syntax for this command is:

rpcinfo -u <server_name> <program_name>

For example, if I wanted to check to see if nfsd was running on jmohr, I would not run it as:

rpcinfo -u jmohr nfsd

If I did, I would end up with the message:

rpcinfo: nfsd is unknown service

This is because the name of the service in RPC’s eyes is nfs. Therefore, the correct syntax would be:

rpcinfo -u jmohr nfs

Which should give you the response:

program 100003 version 2 ready and waiting

If you don’t see this, then run rpcinfo -p to find out what programs are registered.

If you want to find out about what filesystems are being mounted or can be mounted, you can use showmount. On the server, showmount -a will show you which filesystem have been mounted and by whom. This will be in the form host:filesystem. If you want to find out what filesystem are being exported and their permissions, use showmount -e. On jmohr, I get this:

export list for jmohr.siemau.de:

/usr/man(everyone)
/usr/lib(everyone)
/u1access=siemau
/u2(everyone)

Each of the filesystem listed is accessible from every other system with the expection of /u1 which is only accessible from siemau. This is essential what is contained in /etc/exports.

If a client simply stops responding, it may be because the server is down and you have configured a hard mount. If so, the client may wait indefinitely for the server to come back up. Once it does, the processes can continue as before. If the mount is soft, you will (should) get an error after the number of retries specified. (5 by default).