Chapter 5. Setting Up File Systems on the Target

This chapter explains how to set up file systems on devices physically attached to the target system, such as IDE disks, RAM, Flash disks and SCSI disks. If your target is an NFS client only (all its files are physically located on another system such as the host), you do not need to read this chapter.

Before you can perform the procedures in this chapter, you must first configure the system image. See Section 2.1, “Configuration Options” and Chapter 4, Configuring the System Image with File System Support for details.

You must also boot the new system image on the target, and mount the root file system where many of the useful actors reside. This usually involves mounting a file system located on the host workstation where you built the system image. See Mounting an NFS File System for details.

Setting up file systems on the target involves:

  1. Preparing the media on which you will use file systems.

    You must label the media using the disklabel (1M) utility, which writes partition information onto the media based on entries in the disktab(4CC) file.

  2. Creating file systems on the media.

    The newfs(1M) and newfs_msdos(1M) utilities let you create an MS-DOS file system.

    The utility lets you create a UFS file system.

  3. Checking file system integrity.

    The fsck_msdos(1M) utility lets you check an MS-DOS file system.

    The fsck(1M) utility lets you check a UFS file system.

5.1. Formatting a Flash Memory Device

You must format flash memory before you can label it. If your target does not have flash memory, you do not need to read this section.

[Caution]Caution

The following procedure initializes the Flash memory device, erasing all existing data. Be sure to back up existing data on the device before proceeding.

Procedure 5.1. Formatting a Flash Memory Device

  1. Make sure that you have configured your system image with the FLASH feature set to true:

    host% cd 
    build_dir
    host% configurator -list features | grep FLASH
    
    FLASH bool 'true'
    
    
  2. Reboot the target system with a system image that supports Flash memory and includes the special files needed to access it.

  3. Format the Flash memory using the format(1M) command:

    host% rsh 
    target format /dev/rflash0a
    Flash formated : 1560576 bytes available for data
    

Note this command prints on the console the size of available memory. This information might be used to specify the disktab entry for this device.