Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [298]

By Root 2978 0
ro,bg,intr,soft 0 0

The Solaris /etc/vfstab file is slightly different in format, but NFS options are listed similarly. The available options are largely the same as those on other systems.

When you add entries to fstab/vfstab, be sure to create the mount point directories with mkdir. You can make your changes take effect immediately by running mount -a -F nfs on Solaris or HP-UX; use -t instead of -F on Red Hat or FreeBSD.

See page 133 for more information about the fstab file.

The flags field of /etc/fstab specifies options for NFS mounts. Common flags are listed in Table 17.9 on the next page.

Table 17.9 NFS mount flags

a. S = Solaris, H = HP-UX, R = Red Hat Linux, F = FreeBSD

b. This option does not appear in the FreeBSD man pages, but it does work.

c. FreeBSD does not permit this option to be listed explicitly, but it is the default behavior.

d. FreeBSD calls these options by different names: retrans is -x, timeo is -t, rsize is -r, and wsize is -w.

Filesystems mounted hard can cause processes to hang when their servers go down. This behavior is particularly bothersome when the processes in question are standard daemons. In general, the use of the soft and intr options will reduce the number of NFS-related headaches. However, these options can have their own undesirable side effects, such as aborting a 20-hour simulation after it has run for 18 hours just because of a transient network glitch.6

amd, discussed starting on page 509, also provides some remedies for mounting ailments.

The read and write buffer sizes apply to both UDP and TCP mounts, but the optimal values differ. Because you can trust TCP to transfer data efficiently, the values should be higher; Solaris defaults to 32K. For UDP, a good value when server and client are on the same network is 8K. Some systems default to significantly smaller values than these (Red Hat defaults to 1K).

NFS partitions can be unmounted with the umount command.

Secure port restrictions


NFS clients are free to use any TCP or UDP port they like when connecting to an NFS server. However, some servers may insist that requests come from a privileged port (a port numbered lower than 1,024). Others allow this behavior to be set as an option. In the world of PCs and desktop UNIX boxes, the use of privileged ports provides little actual security.

Most NFS clients adopt the traditional (and still recommended) approach of defaulting to a privileged port, which averts the potential for conflict.

17.4 NFSSTAT: DUMP NFS STATISTICS


Most systems provide a command called nfsstat that can display various statistics kept by the NFS system. nfsstat -s displays statistics for NFS server processes, and nfsstat -c shows information related to client-side operations. For example:

chimchim% nfsstat -c

Client rpc:

calls badcalls retrans badxid timeout wait newcred timers

64235 1595 0 3 1592 0 0 886

Client nfs:

calls badcalls nclget nclsleep

62613 3 62643 0

null getattr setattr readlink lookup root read

0% 34% 0% 21% 30% 0% 2%

write wrcache create remove rename link symlink

3% 0% 0% 0% 0% 0% 0%

mkdir readdir rmdir fsstat

0% 6% 0% 0%

This example is from a relatively healthy NFS client. If more than 3% of calls time out, it’s likely that there is a problem with your NFS server or network. You can usually discover the cause by checking the badxid field. If badxid is near 0 with timeouts greater than 3%, packets to and from the server are getting lost on the network. You may be able to solve this problem by lowering the rsize and wsize mount parameters (read and write block sizes). If badxid is nearly as high as timeout, then the server is responding, but too slowly. Either replace the server or increase the timeo mount parameter.

Running nfsstat occasionally and becoming familiar with its output will help you discover NFS problems before your users do.

17.5 DEDICATED NFS FILE SERVERS


Fast, reliable file service is one of the most important elements of any production computing environment. While you can certainly roll

Return Main Page Previous Page Next Page

®Online Book Reader