Feb. 2, 2009, 6:54 p.m.
posted by whitehat
Troubleshooting NFSA basic NFS configuration usually works without problems when the client and server are on the same network. The most common problems are caused by forgetting to start NFS, to edit the /etc/fstab file, or to export the /etc/exports file. Another common cause of failure is the iptables firewall daemon running on either the server or client without the administrator realizing it. When the client and server are on different networks, these checks still apply, but you'll also have to make sure basic connectivity has been taken care of as outlined in Chapter 4, "Simple Network Troubleshooting." Sometimes a firewall being present on the path between the client and server can cause difficulties. As always, no troubleshooting plan would be complete without frequent reference to the /var/log/messages file when searching for additional clues. Figure shows some common NFS errors you'll encounter.
The showmount CommandWhen run on the server, the showmount -a command lists all the currently exported directories. It also shows a list of NFS clients accessing the server, in this case one client has an IP address of 192.168.1.102:
[root@bigboy tmp]# showmount -a
All mount points on bigboy:
*:/home
192.168.1.102:*
[root@bigboy tmp]#
The df CommandThe df command lists the disk usage of a mounted filesystem. Run it on the NFS client to verify that NFS mounting has occurred. In many cases, the root_squash mount option will prevent the root user from doing this, so it's best to try it as an unprivileged user.
[nfsuser@smallfry nfsuser]$ df -F nfs
Filesystem 1K-blocks Used Available Use% Mounted on
192.168.1.100:/home/nfsuser
1032056 346552 633068 36% /home/nfsuser
[nfsuser@smallfry nfsuser]$
The nfsstat CommandThe nfsstat command provides useful error statistics. The -s option provides NFS server stats, while the -c option provides them for clients. Threshold guidelines are provided in Figure.
[root@bigboy tmp]# nfsstat -s
Server rpc stats:
calls badcalls badauth badclnt xdrcall
1547 0 0 0 0
Server nfs v2:
null getattr setattr root lookup readlink
244 100% 0 0% 0 0% 0 0% 0 0% 0 0%
read wrcache write create remove rename
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
link symlink mkdir rmdir readdir fsstat
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
Server nfs v3:
null getattr setattr lookup access readlink
251 19% 332 25% 0 0% 265 20% 320 24% 0 0%
read write create mkdir symlink mknod
39 2% 14 1% 1 0% 1 0% 0 0% 0 0%
remove rmdir rename link readdir readdirplus
0 0% 0 0% 0 0% 0 0% 0 0% 31 2%
fsstat fsinfo pathconf commit
1 0% 34 2% 0 0% 14 1%
[root@bigboy tmp]#
|
- Comment