NFS Administration Guide
この本のみを検索
PDF 文書ファイルをダウンロードする

How To Use the NFS Environment

3

This chapter provides information on how to perform such NFS administration tasks as adding new file systems to share, unsharing file systems, displaying shared local file systems, and displaying mounted file systems. The NFS administration utilities package installs five commands: share, unshare, mount, unmount, and showmount.
NFS Commandspage 13
NFS Administrative Taskspage 14
Adding a New File System to Sharepage 14
Unsharing File Systemspage 15
Displaying Shared Local File Systemspage 15
Displaying Mounted File Systemspage 16

NFS Commands

share(1M) Allows you to add to a server a new file system to share. The share command is also used to set up your NFS servers. See Chapter 2, "How To Set Up NFS Servers." You can also use the share command to display a list of the file systems on your system that are currently shared.
unshare(1M)
Allows you to make a previously available file system unavailable for
mounting by clients.

mount(1M) Used without arguments, this command allows you to mount a remote file system on your computer, or to display a list of file systems, both local and remote, that are currently mounted on your computer. You can also use this command for troubleshooting purposes. See Chapter 5, "NFS Troubleshooting," for more information. Autofs will automatically mount file systems for clients (users) as they request access to them.
umount(1M)
Allows you to remove a remote file system you previously mounted. Use this
command for troubleshooting purposes only

showmount(1M) Shows you which file systems are shared from an NFS server.

NFS Administrative Tasks

This section includes instructions for performing tasks related to managing file systems services with NFS software. After each set of instructions, there are examples of the screen input and output associated with the task, with all relevant assumptions defined and described.

Adding a New File System to Share

  1. Edit the /etc/dfs/dfstab file.

    Add one entry to the file for each file system that you want to have shared automatically. Each entry must be on a line by itself in the file and has the following syntax:


  share [-F nfs] [-o specific-options] [-d description] pathname  

If you type the share command without an argument, the command displays all file systems shared on the server you are currently logged into that are currently shared. If you specify a file system type, the share command displays all file systems of the specified type that are currently shared.
The /etc/dfs/dfstab file allows you to share file systems automatically whenever your system enters run level 3. For example, if you want a directory to be available to clients on a regular basis, and you can anticipate few occasions when you would need to make it unavailable, type a share command for that directory into the dfstab file. Then, whenever you take the system to run level 3, the directory becomes available to clients automatically.
Each line of the file consists of the share command line needed to share a particular file system; the share command you type in the file has the same syntax as the share command you type at the command line.

Unsharing File Systems

The unshare command can be used to unshare any file system--whether the file system was shared explicitly with the share command or automatically through the dfstab file. If you use the unshare command to unshare a file system that you shared through the dfstab file, remember that it will be shared again when you exit and re-enter run level 3.
When you unshare an NFS file system, access from clients with existing mounts is inhibited.

Displaying Shared Local File Systems

* Use the share command with or without specifying nfs.
If you enter the command without arguments, it displays all NFS file systems on your system that are currently shared. If you specify a file system type and no other options, the command displays all file systems of the specified type that are currently shared.

Displaying Mounted File Systems

* Use the mount command with no arguments to display file systems mounted on a client.
Code Example 3-1

  corey(/home/bermudez/Encrypt): mount  
  / on /dev/dsk/c0t3d0s0 read/write/setuid on Mon Nov 29 13:53:47  
  1993  
  /usr on /dev/dsk/c0t3d0s6 read/write/setuid on Mon Nov 29  
  13:53:47 1993  
  /proc on /proc read/write/setuid on Mon Nov 29 13:53:47 1993  
  /dev/fd on fd read/write/setuid on Mon Nov 29 13:53:47 1993  
  /tmp on swap read/write on Mon Nov 29 13:53:52 1993  
  /opt on /dev/dsk/c0t3d0s5 setuid/read/write on Mon Nov 29  
  13:53:54 1993  
  /usr/openwin on /dev/dsk/c0t3d0s7 setuid/read/write on Mon Nov 29  
  13:53:55 1993  
  /net/hostess/install on hostess:/install  
  corey(/home/bermudez/Encrypt):  

-o specific options which is a list of file system type specific options that can be specified after the -o flag. There are different options for NFS specifications (described later in this section).
The options that can follow the -o flag when mounting either NFS file system are:
rw | ro where rw indicates that the file system is to be mounted read/write and ro indicates it is to be mounted read-only. (If no option is specified, rw is the default.)
suid | nosuid where suid indicates that set-uid bits are to be obeyed on execution and nosuid indicates that they are to be ignored. (If no option is specified, set-uid is the default.)
Some NFS specific options that can follow the -o flag are:
bg | fg where bg indicates that a mount retry should be initiated in the background when the server does not respond, and fg indicates it should be initiated in the foreground. If no option is specified, fg is the default. (This option does not apply to autofs.)
nointr
which disallows keyboard interruptions of NFS operations.

retry=n

which is the number of times to retry the mount operation. The default for n is 10,000 times.
timeo=n

which sets the timeout to n tenths of a second. If no option is specified, 1.1 seconds is the default.