This chapter explains how to mount and unmount file systems.
Before you can use most of the procedures described in this chapter, you must first configure your hardware, system image and environment as described in previous chapters.
The mount command, which is a C_INIT(1M) built-in command, allows you either to add a file system at a given point in an existing file system hierarchy, or to view all mounted file systems. Once mounted, a file system is fully operational. Applications can access it using the API provided.
The umount command, another C_INIT built-in command, allows you to remove one or more mounted file systems from the file system hierarchy.
![]() | Warning | |
|---|---|---|
The default version of NFS is version 3. To use NFS version 2, ensure you use the option
to mount commands. | ||
To be able to download actors that are to run dynamically, mount an NFS root file system on the target. This root file system can be generated in the C5 operating system build directory by the command:
% make root |
This command populates the build directory with the root directory that contains binary and configuration files to be accessed by the target system.
As explained, at start-up, the C_INIT daemon reads the sysadm.ini configuration file and executes all the commands. This configuration file may contain instructions to mount the root file system. For example:
% mount hostaddr: C5_root_directory / |
If there are no root file system mount instructions in your sysadm.ini file, mount the root file system explicitly from the shell:
% rsh target mount hostaddr:C5_root_directory / |
where target is the name of the target, or its IP address, hostaddr is the IP address of the NFS host in decimal form (for example 192.82.231.1), and C5_root_directory is the path of the target root directory on the NFS host (for example /home/C5/root).
A message is delivered by C_INIT that depends on whether the /etc/security file exists in the target root directory /home/C5/root. If /etc/security exists, C_INIT displays:
C_INIT: system in secured mode |
If /etc/security does not exist, C_INIT displays:
C_INIT: notice - system not in secured mode |
You can check that the root file system is mounted using:
% rsh target mount |
Make sure that the file system containing the /home/C5/root directory can be accessed by NFS from the remote C5 target.
![]() | Note | |
|---|---|---|
You can also receive a Permission denied message if access rights on the root directory are too restictives:
The root directory must have at least drwxr-xr-x permissions mode. | ||
Procedure 6.2. Mounting a UFS File System
![]() | Note |
|---|---|
When you mount a UFS file system as the root file system, mount first mounts the file system read-only. Next use fsck to check the file system. If the file system check finds and repairs errors, fsck then calls mount with the update option to mount the file system read-write. If the file system check terminates without finding any errors, call mount with the update option to mount the file system read-write | |
Mount the file system on the partition block_device on the host at mount_point:
host% rsh target mount -t ufs block_device mount_point |
If you have mounted the file system as the root file system, check it using the fsck command:
host% rsh target fsck raw_device |
where raw_device is a raw mode special file indicating the partition you mounted as the root file system.
Example 6.2. Mounting a UFS File System as the Root File System
host% rsh target mount -t ufs /dev/da0a / host% rsh target fsck /dev/rda0a host% rsh target mount -t ufs -o update /dev/da0a / |
Mounts the UFS file system on the first partition on the first SCSI drive attached to the C5 system, target, as the root file system.
Procedure 6.4. Mounting an ISO 9660 File System
![]() | Note |
|---|---|
The ISO 9660 file system is used when mounting a CD-ROM. Its use is not, however, restricted to CD-ROM. | |
Procedure 6.7. Managing the /dev, /image and /tmp File Systems
In order to mount the /dev, /image and /tmp file systems automatically, thus providing access to special files and the contents of the system image for example, the C_INIT(1M) actor must find /dev, /image and /tmp mount points in the root file system.
If you create a file system that does not include these mount points, and then mount that file system as root (/), your target system will not have access to special files in /dev, nor to the contents of the system image under /image. Furthermore, function calls that rely on the presence of /tmp will not complete successfully.
Therefore, you should make sure /dev, /image and /tmp mount points are available in each file system that you use as a root file system.
Create a temporary mount point for the file system that you want to use as a root file system and mount it.
For example, if you have mounted an NFS file system located on the host workstation as the root file system, and you want to use an empty, existing IDEdisk UFS file system as the root file system:
host% cd target_root_dir host% mkdir mnt_tmp host% rsh target mount -t ufs /dev/hd0a /mnt_tmp /dev/hd0a on /mnt_tmp |
Create the /dev, /image and /tmp mount points:
host% rsh target mkdir /mnt_tmp/dev host% rsh target mkdir /mnt_tmp/image host% rsh target mkdir /mnt_tmp/tmp |
Copy the /bin, /etc and /lib directories to the RAM disk file system:
host% rsh target cp -R bin etc lib mnt_tmp/ |
Unmount all file systems on the target, including the root file system:
host% rsh target umount /mnt_tmp host% rsh target umount / |
Mount the UFS file system as the root file system and make sure that /dev, for example, is accessible:
host% rsh target mount -t ufs /dev/hd0a / host% rsh target ls /dev bd00 da0g flash1b hd1d rflash0b bpf0 da0h flash1c hd1e rflash0c bpf1 da1 hd0 hd1f rflash1a cd0a da1a hd0a hd1g rflash1b cd0c da1b hd0b hd1h rflash1c cd1a da1c hd0c kmem rrd0a cd1c da1d hd0d knvram rrd0b console da1e hd0e mem rrd0c da0 da1f hd0f null scd0 da0a da1g hd0g nvram0 tty01 da0b da1h hd0h rbd00 zero da0c flash0a hd1 rd0a da0d flash0b hd1a rd0b da0e flash0c hd1b rd0c da0f flash1a hd1c rflash0a |