ChorusOS 5.0 System Administrator's Guide

Creating a File System on a Target System Hard Disk

If your ChorusOS system has a hard disk drive that you want to use to support a local file system, you can use the ChorusOS system utilities to prepare the disk, and create and populate a local file system. It is assumed that you have already been able to mount a root directory through NFS. See "Mounting a Root File System over NFS" for details. It is also assumed that no valuable data has been written to the disk. If you have important data on the hard disk, you must back it up before trying this example.

Before you can prepare the disk, you must be able to access it. Set the appropriate feature or features, depending on whether the hard disk is an IDE or SCSI disk and depending on what file system type you plan to use (see Step 2 for details), build the new system image that supports a hard disk and reboot the target system with the new system image. For example, if you are using TFTP to download onto a target with an IDE disk, then you might do so as follows:


$ cd build_dir
$ configurator -c conf/ChorusOS.xml -set IDE_DISK=true
$ configurator -c conf/ChorusOS.xml -set UFS=true
$ make chorus
$ cp chorus.bmon /tftpboot
$ rsh target reboot

The default sysadm.ini(4CC) system initialization file contains commands that create special files for both IDE and SCSI disks, so you probably do not need to create any special files at this point.

In order to label the disk, you first need an appropriate entry in disktab(4CC). The following example disktab fragment could be used with an ST34311A IDE disk to create two partitions, one small and one large:

ST34311A:\
        :dt=ST506:ty=fixed:se#512:nt#15:ns#63:nc#8944:sf \
        :pa#60480:oa#0:ta=4.4LFS: \
        :pb#8391600:ob#60480:tb=4.4LFS: \
        :pc#8452080:oc#0:tc=unused:

Caution - Caution -

The following step in this example initializes the disk, erasing all existing data. Be sure to back up existing data on the disk before proceeding.


Once the disktab file contains the entry describing the disk geometry, you can proceed to label the disk. For example:


$ rsh target disklabel -w -r hd0 ST34311A

After the disk is labelled, you can create file systems on the disk partitions:


$ rsh target newfs /dev/hd0a
$ rsh target newfs /dev/hd0b

Finally, before using the file systems, you should check them:


$ rsh target fsck -y /dev/hd0a
$ rsh target fsck -y /dev/hd0b

After you have checked the file systems you created, you can mount them into your existing file system hierarchy and use them.