|
» |
|
|
|
This section provides procedures and troubleshooting
information for the Network File System (NFS). NFS allows a computer to access a file system
that resides on another computer’s disks, as though the file
system were installed locally. The NFS server is the computer to which the disk is physically attached. NFS clients are the computers that use the
file system remotely. Before an NFS client can mount a file system that resides on the NFS server’s
disks, the NFS server must share it. Before you can share file systems, you must install
and configure NFS software on both the server and client systems.
In most cases this will have been done when the systems were installed.
Use the NFS Services Administrator's Guide if you need to install NFS. For information and guidelines on planning a workgroup’s
file-sharing configuration, see the HP-UX System Administrator’s
Guide: Overview. This section contains information on the following: See also: Exporting versus Sharing | |
Prior to HP-UX 11i v3, file systems were “exported” for use by other systems, using the exportfs command. Exported file system information was stored in the /etc/exports file. Beginning with HP-UX 11i v3, file systems are “shared” with other systems with the share command. Shared file system information is stored in the /etc/dfs/dfstab file. For conversion information, see
the HP-UX 11i Version 3 Release Notes. Enabling and Disabling the NFS Server and Client | |
The following procedures describe how to enable
or disable the NFS server and client. Enable or Disable the NFS Server with Text-Based HP SMHLog
in to the server as superuser. Start
HP SMH; see “Starting Text-Based HP SMH”. Navigate
to Network Services. Press n, Networking and Communications Press s, Network Services Configuration Press k, Network Services
Highlight NFS Server. Press Tab A to pull down the Actions menu. Select
one of: - Disable
To stop the NFS server. - Enable
To start the NFS server. - Restart
To restart the NFS server.
Enable or Disable the NFS Client with Text-Based HP SMHLog
in to the client as superuser. Start
HP SMH; see “Starting Text-Based HP SMH”. Navigate
to Network Services. Press n, Networking and Communications Press s, Network Services Configuration Press k, Network Services
Highlight NFS Client. Press Tab A to pull down the Actions menu. Select
one of: - Disable
To stop the NFS client. - Enable
To start the NFS client. - Restart
To restart the NFS client.
Sharing an HP-UX Directory | |
Use either of the following procedures to set
up NFS shares on the server. | | | | | NOTE: An NFS server can share an ordinary file as well
as a directory. In either case, the NFS client must mount the shared
file system on a directory. | | | | |
Share a Directory Using Text-Based HP SMHLog
in to the server as superuser. Start
HP SMH, as described in “Starting Text-Based HP SMH”. Enable
the NFS server, if necessary, as described in “Enabling and Disabling the NFS Server and Client”. Navigate
to the Share/Unshare File System screen. Press n, Networking and Communications. Press s, Network Services Configuration. Press f, Networked File Systems. Press s, Share/Unshare File System.
The currently defined shared directories are displayed
with columns indicating: - Local Directory
The full path of the local
directory name of the file system. - Currently
Shared
Whether the file system
is currently shared; is it an entry in /etc/dfs/sharedtab? - Permanently
Shared
Is it an entry in /etc/dfs/dfstab? - Logging
Enabled
Is the use of the file
system being logged.
Press s, Share a File System. A screen showing the needed fields is displayed. Enter values as described in the share(1M) and share_nfs(1M) manpages. (Optional)
Select Preview to see the commands that will
be executed. Select OK to share the directory or Cancel to quit the process.
Share a Directory Using HP-UX CommandsLog
into the server as superuser. If
the system is not already configured as an NFS server: Edit /etc/rc.config.d/nfsconf, setting the following values: NFS_CORE=1
NFS_SERVER=1
START_MOUNTD=1
|
| | | | | NOTE: You can also use the setoncenv command to set and display NFS and other Open Network Computing
configuration variables. See setoncenv(1M). | | | | |
Run
the nfs.server script: # /sbin/init.d/nfs.server start |
Edit /etc/dfs/dfstab, adding an entry for each directory that
is to be shared. The entry identifies the directory and (optionally)
the systems that can import it. The entry should look something like
this: share -F nfs -o access=dept27:wsj6700 /opt/hp/gnu/bin700/emacs
|
See share_nfs(1M) for more information on the -o suboptions access, ro, and rw. To
share all the entries in /etc/dfs/dfstab: Or to just share the new file system: # /usr/sbin/share /opt/hp/gnu/bin700/emacs |
Mounting a Shared File System (HP-UX to HP-UX) | |
Before you begin, you need to: Check that the directory
on the local (client) system that you are mounting on either: Does not already exist; or
Make sure that the client
has permission to share the file system from the server. This requires an entry in /etc/dfs/dfstab on the server; see Step 3 under “Share a Directory Using HP-UX Commands”. Decide what type of mount
you want. See Table 5-1: “Deciding Which Type of NFS Mount to Use”. A standard NFS mount.
Use one of these procedures: An automounted NFS file
system using AutoFS. Use this procedure:
Standard-Mount a Shared File System Using Text-Based HP SMH | | | | | NOTE: The Disks and File Systems functional area performs standard mounts. The Networking
and Communications functional area performs automounts. | | | | |
Log
in to the client as superuser. Start
HP SMH, as described in “Starting Text-Based HP SMH”. Enable
the NFS client, if necessary, as described in “Enabling and Disabling the NFS Server and Client”. Navigate
to the Add A New NFS File System screen. Press f, Disks and File Systems. Press f, File Systems - View or Manage File
Systems. Press n, Add NFS.
The Add A New NFS File System screen is displayed Fill
in the fields. (The default values are marked.) Mount Point: The full name of the local directory. Remote Server: The full name of the system sharing the file system. Remote Directory: The full name of the shared file system. Mount method: Check one. Only mount (do not store
any config in /etc/fstab) Save config in /etc/fstab (will not be mounted) Mount now and save config
in /etc/fstab (default)
Check all that apply.
(The keywords in parentheses appear in /etc/fstab.) Mount read-only (ro/rw) If
this is not checked, the file system will be mounted read-write. If
it is checked, the file system will be mounted read only. If the file system is shared read-only, it is
a good idea to check this. Do not auto mount (noauto) If this is not checked,
the file system is mounted automatically when the system boots. If
it is checked, you will have to mount it manually with the mount command. This is not related to NFS
automounting. Enable SUID (suid/nosuid) (default) If this is checked, programs on the shared file system
that have their setuid bit set will run under the program’s
user ID. If this is not checked, the programs will run under the user’s
user ID. Enable Quota (quota/noquota) (default) If this is checked, the local system enforces its quota(1) quotas. If it is not checked, the local quotas are
not enforced. Quotas on the server are always enforced.
The rest of the options are described in the mount_nfs(1M) manpage. Usually, they are left unchanged. (Optional)
Select Preview to see the commands that will
mount the file system. Press OK to continue. Select New NFS to execute the commands or Cancel to quit the process.
Automount a Shared File System Using Text-Based HP SMH | | | | | NOTE: The Disks and File Systems functional area performs standard mounts. The Networking
and Communications functional area performs automounts. | | | | |
Log
in to the client as superuser. Start
HP SMH, as described in “Starting Text-Based HP SMH”. Enable
the NFS client, if necessary, as described in “Enabling and Disabling the NFS Server and Client”. Navigate
to the Networked File Systems (Automounter) screen. Press n, Networking and Communications. Press s, Network Services Configuration. Press f, Networked File Systems. Press a, Automounted Remote File Systems.
The Networked File Systems (Automounter) screen is displayed. The currently defined shared
directories are displayed with columns indicating: - Mount Directory
The full path of the local
directory name of the file system. - Type
Auto. - Remote Server
The full host name of
the server. - Remote Directory
The full path of the file
system on the remote server. - Where Configured
The full path of the file
where the mount entry is stored.
Fill
in the fields identifying the directories to be mounted. The information
is similar to the fields for standard mount; see Step 5 in “Standard-Mount a Shared File System Using Text-Based HP SMH”. For details of the other options,
see the automount(1M) manpage.
Standard-Mount a Shared File System Using HP-UX CommandsLog
in to the client as superuser. Ensure
the client is configured to mount file systems via NFS. The simplest
method is to use HP SMH; see “Enabling and Disabling the NFS Server and Client”. Create
the local directory on the client if it does not exist, for example: | | | | | NOTE: If the directory does exist, its contents will
be hidden when you mount the remote directory, and will not be usable
until you unmount it. | | | | |
Add
an entry to/etc/fstab so the file system will
be automatically mounted at boot time. nfs_server:/nfs_server_dir /client_dir nfs options 0 0
|
For example: fancy:/opt/adobe /opt/adobe nfs defaults 0 0
|
Mount
the remote file system. The following command
forces the system to reread /etc/fstab and mount
all the file systems: Or you can just mount the one file system: # /usr/sbin/mount /opt/adobe |
Troubleshooting NFS | |
Table 5-2 outlines
some troubleshooting techniques for common NFS problems. Table 5-2 Troubleshooting NFS Problem | What To Do |
---|
Individual client can’t
import from one or more servers | Verify
the following on the client: The local directory exists on the client. If it does
not exist, create it using mkdir. For example: LAN cable is intact and connected, and all connections
are live. /etc/hosts exists and has “Requisite Entries”. /etc/fstab exists and has “Requisite Entries”, and the entries still point to valid directories on the server. /etc/resolv.conf exists and has “Requisite Entries” (DNS only) /etc/rc.config.d/nfsconf has NFS_CLIENT=1 View the file directly, or use
HP SMH to see that NFS_CLIENT is enabled (see “Enabling and Disabling the NFS Server and Client”).
Verify the following on the servers: | All clients can’t
import from a given server | Do the following on the server: Ensure that the server system is up and running, and
that the LAN connection between the server and clients is live (can
you ping the clients from the server and vice versa?). Ensure
that /etc/rc.config.d/nfsconf has NFS_CORE=1, and NFS_SERVER=1 or use HP SMH to see if NFS Server is enabled (see “Enabling and Disabling the NFS Server and Client”). Ensure that the
file systems that the clients are trying to mount are listed in /etc/dfs/dfstab. Check /etc/dfs/dfstab directly or use HP SMH (see “Sharing an HP-UX Directory”). If these remedies fail, and the configuration looks
good (all the tests above), then the server may not have booted correctly;
try rebooting the server.
| Stale NFS
file handle This is common on NFS clients
after a server has crashed, or been rebooted before clients have unmounted
NFS file systems, or after /etc/dfs/dfstab has
been changed on the server. | On the clients: Use the rmsf command with the -x and -H options to remove stale device
special files. For details, see rmsf(1M).
or … Ensure that there are no open files in the affected
file systems; then try unmounting and remounting them. Try this first if /etc/dfs/dfstab has been changed on the server (directly
or via HP SMH).
On the server: Run: Try this first if server has just rebooted.
| On an NFS server, umount fails. | Check that all files are closed in the file system
to be unmounted, and that it is not anyone’s working directory
on the system (host) from which it is to be unmounted. Note that although fuser(1M) can be used to check for open files, it is not able
to detect files in a different directory opened within an editor. Try this if the directory
is shared:
|
The following entries are required in /etc/hosts, /etc/fstab, and /etc/resolv.conf:
/etc/hosts: System host name and IP address, for example: 12.0.14.123 fredsys fredsys.mysite.myco.com
|
An entry similar to the following: 127.0.0.1 localhost loopback #[no SMTP]
|
/etc/resolv.conf (needed for
Domain Name Service (DNS) only): The name of the domain in which this system resides,
for example: At least one name server, for example:
Recovering Network Services after a Power Failure | |
This section describes how to troubleshoot problems
you and your system users are likely to encounter when rebooting after
a general power failure or outage. The examples assume you are using
DNS (Domain Name Service). RPC_PROG_NOT_REGISTERED name_server rcmd: hostname: Unknown host rcmd:hostname: Not in database rcmd:hostname: Access denied When the Domain Name Server Goes Down If a system powers up before the
Domain Name Server does, the system will not find the name server
and, when users tries to reach another system, they will get the message: rcmd: hostname: Unknown host
|
The simplest solution is to reboot the system after the name server has been rebooted. When a Client Can’t Import Directories from a Server Do the troubleshooting checks described
under “Troubleshooting NFS”. If
these fail, and the client is getting messages such as: rcmd: hostname: Not in database
|
rcmd: hostname: Access denied
|
then do the following procedure:
Moving or Reusing a Shared Directory | |
If you rename an NFS-mounted directory, NFS clients
must unmount and remount the imported directory before they can see
the new contents. For example, if a server is sharing /opt/myapp, and you move /opt/myapp to /opt/myapp.old then rebuild and repopulate /opt/myapp, all the NFS clients must unmount and remount the directory, for example (as superuser on
each client): # umount /opt/myapp
# mount -a |
Any client on which this is not done will continue
to see the former contents of /opt/myapp, that
is /opt/myapp.old. You can encounter the same problem in a slightly
different way when you reuse an LVM volume. For example, suppose you unmount an obsolete file
system named /projects from a file server named fp_server, and subsequently reuse the logical volume,
mounting a file system /newprojects on it. Any client that fails to unmount /projects will see the contents of fp_server:/newprojects, labeled /projects.
|