ChorusOS 5.0 System Administrator's Guide

Chapter 7 Sharing 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 4, Configuring the System Image with File System Support 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 5, Setting Up File Systems on the Target.


For a detailed example, including instructions on setting the appropriate features and tunables, see "Setting Up an NFS Server on the Target System".

Setting Up the Target as an NFS Server

Setting up the target as an NFS server involves:

A detailed example is provided in "Setting Up an NFS Server on the Target System".

Setting Up the Configuration Files

Unless you build the following files 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.

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

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

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

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

The rpcbind 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.

  1. Make sure that /sbin is visible from the target system:


    host% rsh target ls /sbin
    

    If you have not yet mounted a root file system, such as host:build_dir/root, see "File System Commands".

  2. Run the rpcbind daemon:


    host% rsh target sbin/rpcbind
    
  3. Run the mountd daemon:


    host% rsh target sbin/mountd
    
  4. Run the nfsd daemon:


    host% rsh target sbin/nfsd -ut -n 3
    

    The above command creates three servers for TCP and UDP clients.

  5. 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% /sbin/rpcinfo -p target