Chapter 4 How to Share Target File Systems
Over NFS
This chapter explains how to set up an NFS server
on the target system, allowing you to share files located on devices attached
to the target with other systems on the network. If your target is an NFS client only (all its files are physically located on another
system such as the host workstation), or if you do not intend to export target
file systems, you can skip this chapter.
Before you can perform the procedures in this chapter, you must first
configure the system image. See Chapter 2, How to Configure the System
Image for details.
Note -
The NFS server can only export UFS
file systems. For details about creating a UFS file system
on the target, see Chapter 3, How to Set Up File Systems On
the Target.
Setting up the target as an NFS server involves:
Setting Up the Configuration Files
Unless you build the files below into your system image, they probably
reside in build_dir/root/etc, which you generate using the make root command
in the directory where you build system images.
-
Make sure /etc/exports specifies all the file systems
located on the ChorusOS system that you plan to export through NFS. Entries
in the /etc/exports file follow the form:
export_dir options
where export_dir indicates a file system
to export, and options allows you to specify whether
any directory under export_dir can be mounted by
another system, which users, groups or netgroups have access to export_dir, whether the directory should be exported read-only
and so forth. See exports(4CC) for details.
-
Make sure /etc/hosts contains the IP
addresses and hostnames of NFS clients. Entries in the /etc/hosts file follow the form:
IP_address hostname [other_hostname ...]
where IP_address is the IP
address of the system, hostname is the hostname
of the system and other_hostnames are alternate
hostnames. See hosts(4CC)
for details.
-
Make sure /etc/netgroup is readable by everyone,
and contains descriptions of all netgroups --
sets of hosts, users and domains -- used in /etc/exports.
Entries in the /etc/netgroup file follow the form:
netgroup (hosts,users,domains)
where netgroup is the name of the group, hosts specifies the hostnames of the systems in the group, users specifies the users in the group, and domains specifies the domains that belong to the group. See netgroup(4CC)
for details.
-
Make sure /etc/networks contains correct information
about available networks. Entries in the /etc/networks
file follow the form:
network_name network_number network_aliases
where network_name is the primary name for
the network, network_number is the IP network number prefix, such as 127 for loopback
or 192.33.15 for a specific class-C network, and network_aliases are alternate names for the network. See networks(4CC)
for details.
Starting the Basic Name Server
(inetNShost(1M))
The basic name server provides the gethostbyname(3STDC)
service to NFS daemons. It runs on the target and requires
access to /etc/hosts and /etc/networks.
-
Make sure that /etc is visible
from the target system:
host% rsh target arun /bin/ls /etc
|
If you have not yet mounted a root file system, see "5.1 How to Mount and Unmount File Systems".
-
Run the name server in the background:
host% rsh target arun /bin/inetNShost
|
See the ChorusOS 4.0 Network Administration Guide and inetNS(1M) for details on more advanced
name servers.
Starting the NFS
Daemons
The portmap daemon must be running to handle conversion
of RPC calls, the mountd daemon listens for remote mount
requests from other systems and the nfsd daemon provides
remote NFS services to NFS client systems.
-
Make sure that /etc is visible
from the target system:
host% rsh target arun /bin/ls /etc
|
If you have not yet mounted a root file system, such as host:build_dir/root,
see "5.1 How to Mount and Unmount File Systems".
-
Run the portmap daemon in background:
host% rsh target arun /etc/portmap &
|
-
Run the mountd daemon in background:
host% rsh target arun /etc/mountd &
|
-
Run the nfsd daemon in background:
host% rsh target arun /etc/nfsd -ut -n 3 &
|
The above command creates three servers for TCP and UDP clients.
-
Check that NFS is one of the TCP/UPD
services available from the target. On a host workstation running the Solaris
operating environment, the following example displays the registered RPC services available on the target:
host% /bin/rpcinfo -p target
|