Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX System Administrator's Guide: Configuration Management: HP-UX 11i Version 3 > Chapter 5 Configuring Networking

Configuring the Network File System (NFS)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

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 SMH

  1. Log in to the server as superuser.

  2. Start HP SMH; see “Starting Text-Based HP SMH”.

  3. Navigate to Network Services.

    1. Press n, Networking and Communications

    2. Press s, Network Services Configuration

    3. Press k, Network Services

  4. Highlight NFS Server.

  5. Press Tab A to pull down the Actions menu.

  6. 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 SMH

  1. Log in to the client as superuser.

  2. Start HP SMH; see “Starting Text-Based HP SMH”.

  3. Navigate to Network Services.

    1. Press n, Networking and Communications

    2. Press s, Network Services Configuration

    3. Press k, Network Services

  4. Highlight NFS Client.

  5. Press Tab A to pull down the Actions menu.

  6. 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 SMH

  1. Log in to the server as superuser.

  2. Start HP SMH, as described in “Starting Text-Based HP SMH”.

  3. Enable the NFS server, if necessary, as described in “Enabling and Disabling the NFS Server and Client”.

  4. Navigate to the Share/Unshare File System screen.

    1. Press n, Networking and Communications.

    2. Press s, Network Services Configuration.

    3. Press f, Networked File Systems.

    4. 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.

  5. 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.

  6. (Optional) Select Preview to see the commands that will be executed.

  7. Select OK to share the directory or Cancel to quit the process.

Share a Directory Using HP-UX Commands

  1. Log into the server as superuser.

  2. If the system is not already configured as an NFS server:

    1. 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).
    2. Run the nfs.server script:

      # /sbin/init.d/nfs.server start
  3. 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.

  4. To share all the entries in /etc/dfs/dfstab:

    # /usr/sbin/shareall

    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:

 

NOTE:

You do not have to call the directory on the client by the same name it has on the server, but it will make things simpler (more transparent) for your users if you do. If you are running applications configured to use specific path names, you must make sure those path names are the same on every system on which the applications run.

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.
  1. Log in to the client as superuser.

  2. Start HP SMH, as described in “Starting Text-Based HP SMH”.

  3. Enable the NFS client, if necessary, as described in “Enabling and Disabling the NFS Server and Client”.

  4. Navigate to the Add A New NFS File System screen.

    1. Press f, Disks and File Systems.

    2. Press f, File Systems - View or Manage File Systems.

    3. Press n, Add NFS.

    The Add A New NFS File System screen is displayed

  5. 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.

  6. (Optional) Select Preview to see the commands that will mount the file system. Press OK to continue.

  7. 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.
  1. Log in to the client as superuser.

  2. Start HP SMH, as described in “Starting Text-Based HP SMH”.

  3. Enable the NFS client, if necessary, as described in “Enabling and Disabling the NFS Server and Client”.

  4. Navigate to the Networked File Systems (Automounter) screen.

    1. Press n, Networking and Communications.

    2. Press s, Network Services Configuration.

    3. Press f, Networked File Systems.

    4. Press a, Automounted Remote File Systems.

    The Networked File Systems (Automounter) screen is displayed.

  5. 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.

  6. 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 Commands

  1. Log in to the client as superuser.

  2. 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”.

  3. Create the local directory on the client if it does not exist, for example:

    # mkdir /opt/adobe
    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.
  4. 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
  5. Mount the remote file system.

    The following command forces the system to reread /etc/fstab and mount all the file systems:

    # /usr/sbin/mount -a

    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

ProblemWhat To Do
Individual client can’t import from one or more servers

Verify the following on the 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:

    # /usr/sbin/shareall

    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:

    # /usr/sbin/unshare dir

 

Requisite Entries

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/fstab:

  • /etc/resolv.conf (needed for Domain Name Service (DNS) only):

    • The name of the domain in which this system resides, for example:

      domain mysite.myco.com
    • At least one name server, for example:

      nameserver 12.0.14.165

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).

Symptoms and Keywords

RPC_PROG_NOT_REGISTERED

name_server

rcmd: hostname: Unknown host

rcmd:hostname: Not in database

rcmd:hostname: Access denied

What To Do

  1. 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.

  2. 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:

    1. Log in to the server as superuser.

    2. Start HP SMH, as described in “Starting Text-Based HP SMH”.

    3. Enable or restart the NFS server, as described in “Enabling and Disabling the NFS Server and Client”.

    4. Exit HP SMH.

    5. Log in to the client as superuser.

    6. Start HP SMH, as described in “Starting Text-Based HP SMH”.

    7. Enable the NFS client, as described in “Enabling and Disabling the NFS Server and Client”.

    8. Exit HP SMH.

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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2008 Hewlett-Packard Development Company, L.P.