ChorusOS 5.0 System Administrator's Guide

Mounting a Root File System over NFS

The first thing to do before mounting the root file system over NFS is to build a root file system for your target if you have not done so already. Further examples are provided in Chapter 8, Further File System Administration Examples .

Change to the directory where you build system images and make root:


$ cd build_dir
$ make root

If the root directory that is built under build_dir cannot be exported through NFS, move or copy it to a directory you can export:


$ cp -R build_dir/root exportable_dir

Next, export the directory so that it is readable by the ChorusOS target system. On a host workstation running the Solaris operating environment, you can export the directory by adding a line to /etc/dfs/dfstab, similar to the following:

share -F nfs -o ro -d "target root dir" /export/ChorusOS/root

In order for the directory to be shared, restart the NFS server on the host workstation:


$ su
Password: root password for host
# /etc/init.d/nfs.server start

You can then verify that the directory is indeed available:


$ showmount -e host
/export/chorusOS/root	(everyone)

After you have verified that the target system root directory has been exported correctly on the host workstation, you may prepare a system image that mounts the directory during system initialization.

Make sure that the mount command is built into the ADMIN system actor by setting the ADMIN_MOUNT feature to true:


$ configurator -c conf/ChorusOS.xml -set ADMIN_MOUNT=true

Make sure that the ChorusOS system can act as an NFS client by setting the NFS_CLIENT feature to true and the C_OS buffer tunables to appropriately large values:


$ configurator -c conf/ChorusOS.xml -set NFS_CLIENT=true
$ configurator -c conf/ChorusOS.xml -set iom.nbuf=8

Add the necessary commands to configure the network interface and mount the directory to the system initialization script, sysadm.ini(4CC), located in build_dir/conf/sysadm.ini:

#
# Set umask to 0 during system configuration.
#
umask 0

# 
# Prepare Ethernet and loopback interfaces so that you can access the
# host workstation (129.157.197.144) where the root file system is
# located. Target system IP address here is 129.157.197.88.
#
# Note that you do not have to use Ethernet as your network interface,
# but Ethernet is simple to set up, so we have used it here to avoid
# cluttering the example.
#
mkdev ifeth 0
mkdev lo 0
ifconfig ifeth0 129.157.197.88 netmask 0xffffff00 broadcast 129.157.197.255
ifconfig lo0 127.0.0.1 up

#
# Reset umask to default.
#
umask 22

#
# During system initialization, the target mounts a pseudo / file
# system, but you can mount a new root over the old one. So, mount the
# root file system through NFS.
#
mount 129.157.197.144:/export/target/build/root /

#
# Display mount status to the console.
#
mount

Build and place the new system image where it can be downloaded onto the target and reboot the ChorusOS system. If you are using TFTP to download onto a PC target for example, then you might do so as follows:


$ cp chorus.bmon /tftpboot
$ rsh target reboot

After the system reboots, the mount information should appear on the console. You could also run one of the actors located under the root file system to verify that everything is functioning correctly:


$ rsh target  ls /bin
arp            domainname     ls             pax            tclsh 
chorusNSinet   fsck           mkdir          pppstart       touch 
chorusNSsite   fsck_dos       mkfifo         profctl        umount 
chorusStat     ftp            mknod          profex         uname 
cp             hostname       mount          rdbc           ypbind 
cs             ifconfig       mv             rm             ypcat 
date           inetNSdns      netstat        rmdir          ypmatch 
dd             inetNShost     newfs          route          ypwhich 
df             inetNSien116   newfs_dos      shutdown 
disklabel      inetNSnis      nfsstat        sysctl