ChorusOS 5.0 System Administrator's Guide

Using disklabel to Label a Disk

Once you have correctly specified disk information in /etc/disktab, you are ready to use disklabel.


Caution - Caution -

The following procedure initializes the local disk, erasing all existing data. Be sure to back up existing data before proceeding.


  1. Boot the target system with a system image that supports the hardware you want to label and that includes the special files needed to access that hardware.

  2. Update the disk label on the device, using disklabel as follows:


    host% rsh target disklabel -w -r device label name
    

    where device is an abbreviated form of the device name such as da0, label is the label found in /etc/disktab and name is an optional string identifier up to sixteen characters long with no whitespace.

  3. Check that the disk label is correctly updated, using disklabel as follows:


    host% rsh target disklabel -r device
    

    where device is an abbreviated form of the device name such as da0.

Another way of using disklabel is with a protofile. A protofile is a text file describing one single disk and has the same format as the output of a simple disklabel disk.

For instance, to create a single partition on a new disk, you can type the following :


rsh target disklabel device > root/tmp/device_proto  
rsh target disklabel -R -r device /tmp/device_proto         

If device is da0, for instance, this will create a single partition da0c that can be used with newfs:


rsh target newfs /dev/da0c

Of course, you can edit and modify the device_proto file between both of these operations to create additional partitions.