Online Book Reader

Home Category

Managing NFS and NIS, 2nd Edition - Mike Eisler [205]

By Root 447 0
then the host's name and IP address are mismatched in the name service hosts file or in the client's /etc/hosts file. However, this could also indicate a breach of security, particularly if the host is on another network or the host number is known to be unallocated.

Finally, the client can review its currently mounted filesystems using df, getting a brief look at the mount points and corresponding remote filesystem information:

df Shows current mount information.

df -F fstype Looks at filesystems of type fstype only.

df directory Locates mount point for directory.

For example:

% df -k -F nfs

filesystem kbytes used avail capacity Mounted on

onaga:/export/onaga 585325 483295 43497 92% /home/onaga

thud:/export/thu 427520 364635 20133 95% /home/thud

mahimahi:/export/mahimahi

371967 265490 69280 79% /home/mahimahi

The -k option is used to report the total space allocated in the filesystem in kilobytes. When df is used to locate the mount point for a directory, it resolves symbolic links and determines the filesystem mounted at the link's target:

% ls -l /usr/local/bin

lrwxrwxrwx 1 root 16 Jun 8 14:51 /usr/local/bin -> /tools/local/bin

% df -k /usr/local/bin

filesystem kbytes used avail capacity Mounted on

mahimahi:/tools/local 217871 153022 43061 78% /tools/local

df may produce confusing or conflicting results in heterogeneous environments. Not all systems agree on what the bytes used and bytes available fields should represent; in most cases they are the number of usable bytes available to the user left on the filesystem. Other systems may include the 10% space buffer included in the filesystem and overstate the amount of free space on the filesystem.

Detailed mount information is maintained in the /etc/mnttab file on the local host. Along with host (or device) names and mount points, mnttab lists the mount options used on the filesystem. mnttab shows the current state of the system, while /etc/vfstab only shows the filesystems to be mounted "by default." Invoking mount with no options prints the contents of mnttab ; supplying the -p option produces a listing that is suitable for inclusion in the /etc/vfstab file:

% mount

/proc on /proc read/write/setuid on Wed Jul 26 01:33:02 2000

/ on /dev/dsk/c0t0d0s0 read/write/setuid/largefiles on Wed Jul 26 01:33:02 2000

/usr on /dev/dsk/c0t0d0s6 read/write/setuid/largefiles on Wed Jul 26 01:33:02 2000

/dev/fd on fd read/write/setuid on Wed Jul 26 01:33:02 2000

/export/home on /dev/dsk/c0t0d0s7 setuid/read/write/largefiles on Wed Jul 26 01:33:04 2000

/tmp on swap read/write on Wed Jul 26 01:33:04 2000

/home/labiaga on berlin:/export/home11/labiaga intr/nosuid/noquota/remote on Thu Jul 27 17:39:59 2000

/mnt on paris:/export/home/rome read/write/remote on Thu Jul 27 17:41:07 2000

% mount -p

/proc - /proc proc - no rw,suid

/dev/dsk/c0t0d0s0 - / ufs - no rw,suid,largefiles

/dev/dsk/c0t0d0s6 - /usr ufs - no rw,suid,largefiles

fd - /dev/fd fd - no rw,suid

/dev/dsk/c0t0d0s7 - /export/home ufs - no suid,rw,largefiles

swap - /tmp tmpfs - no rw

berlin:/export/home11/labiaga - /home/labiaga nfs - no intr,nosuid,noquota

paris:/export/home/rome - /mnt nfs - no rw

Although you can take the output of the mount -p command and include the NFS mounts in the client's /etc/vfstab file, it is not recommended. Chapter 9 describes the many reasons why dynamic mounts are preferred. However, if static cross-mounting is required, use the background (bg) option to avoid deadlock during server reboots when two servers cross-mount filesystems from each other and reboot at the same time.

NFS statistics

The client- and server-side implementations of NFS compile per-call statistics of NFS service usage at both the RPC and application layers. nfsstat -c displays the client-side statistics while nfsstat -s shows the server tallies. With no arguments, nfsstat prints out both sets of statistics:

% nfsstat -s

Server rpc:

Connection oriented:

calls badcalls nullrecv badlen xdrcall dupchecks

10733943 0 0 0 0 1935861

dupreqs

0

Connectionless:

calls badcalls nullrecv badlen

Return Main Page Previous Page Next Page

®Online Book Reader