Configuring NFS
From Wiki-UX.info
Contents
Configure NFS Server
- Ensure the NFS subsystem is in the kernel.
- Edit the server's /etc/rc.config.d/nfsconf file.
- Start NFS server daemons.
- Create the /etc/exports file.
- Export the directories.
- Check the server configuration.
Configure NFS Client
- Ensure the NFS subsystem is in the kernel.
- Edit the server's /etc/rc.config.d/nfsconf file.
- Start NFS server daemons.
- Create the /etc/exports file.
- Export the directories.
- Check the server configuration.
# ps -ef | grep [n]fsd | wc -l
17
# ps -ef | grep [n]fsd | sort -n -k 3,3
root 17972 1 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17973 1 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17974 17973 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17975 17973 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17976 17973 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17990 17973 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17991 17973 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17992 17973 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17977 17974 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17978 17974 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17980 17974 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17987 17975 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17988 17975 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17989 17975 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17979 17976 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17981 17976 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
root 17983 17976 0 Jun 25 ? 0:00 /usr/sbin/nfsd 16
Ensure that the NFS Subsystem is in the Kernel
HP-UX 11.0 / 11i v1 (11.11)
# kmsystem | grep nfs_
nfs_client Y -
nfs_core Y -
nfs_server Y -
HP-UX 11i v2 (11.23)
# kcmodule | grep nfs_
nfs_client static best
nfs_core static best
nfs_server static best
HP-UX 11i v3 (11.31)
# kcmodule | grep nfs_
nfs_client static best
nfs_client_pv2 static best
nfs_client_pv3 static best
nfs_client_pv4 static best
Configuring AutoFS
- Automatically mount NFS file systems when needed.
- Automatically unmount NFS file system that are no longer being accessed. There is a 5 minutes timeout.
- May be configured to provide load balancing across multiple NFS servers.
Enable AutoFS
AutoFS is enable in the "/etc/rc.config.d/nfsconf" using the [ AUTOMOUNT | AUTOFS ] variable. The AUTOMOUNTD variable can be use to add additional flags to the start script, like "-v" or "-T".
The -T flag Expand each RPC call and display it to /var/adm/automount.log.
The -v flag increases the verbosite of the log status messages to /var/adm/syslog/syslog.log.
- Note: Don't enable AUTOMOUNT and AUTOFS at the same time.
Configuring the "-hosts" map
Edit "/etc/auto_master" file and add the configuration line "/net -hosts - soft,nosuid".
Example:
-> /etc/auto_master /net -hosts -soft,nosuid
Direct Map
-> /etc/auto_master /- /etc/auto.direct
-> /etc/auto.direct /usr/contrib/games -ro gamesvr:/usr/contrib/games /opt/tools -ro toolsvr:/opt/tools /var/mail -rw mailsvr:/var/mail
Indirect Map
-> /etc/auto_master /drawings /etc/auto.drawings
-> /etc/auto.direct gizmos -ro gizmosvr:/drawings/gizmos gadgets -ro gadgetsvr:/drawings/gadgets widgets -rw widgetsvr:/drawings/widgets
Reference
- automountd(1M)