System Administration Guide, Volume I

Creating and Examining a Disk Label

Labeling a disk is usually done during system installation or when you are creating new disk slices. You may need to relabel a disk if the disk label is corrupted (for example, from a power failure).

The format utility will attempt to automatically configure any unlabeled SCSI disk. If format is able to automatically configure an unlabeled disk, it will display a message like the following:


	c1t0d0:configured with capacity of 404.65MB

How to Label a Disk

  1. Become superuser.

  2. Enter the format utility.


    # format
    
  3. Enter the number of the disk that you want to label from the list displayed on your screen.


    Specify disk (enter its number):1
    
  4. Use the table below to determine how to label the disk.

    If the Disk Is Unlabeled and Was Successfully Configured ... 

    If the Disk Was Labeled and You Want to Change the Type, or Format Was Not Able to Automatically Configure the Disk ... 

    Format will ask if you want to label the disk. Go to step 5 to label the disk. 

    You must specify the disk type. Go to steps 6-7 to set the disk type and label the disk. 

  5. Label the disk by typing y at the Label it now? prompt.


    Disk not labeled. Label it now? y
    

    The disk is now labeled. Go to step 10 to exit the format utility.

  6. Enter type at the format> prompt.


    format> type
    

    Format displays the Available Drive Types menu.

  7. Select a disk type from the list of possible disk types.


    Specify disk type (enter its number)[8]: 8
    
  8. Label the disk. If the disk is not labeled, the following message is displayed.


    Disk not labeled. Label it now? y
    

    Otherwise you are prompted with this message:


    Ready to label disk, continue? y
    
  9. Use the verify command from the format main menu to verify the disk label.


    format> verify 
    
  10. Exit the format utility by typing q at the format> prompt.


    partition> q
    format> q
    #

Example--Labeling a Disk

The following example automatically configures and labels a 424-Mbyte disk.


# format
	c1t0d0: configured with capacity of 404.65MB
 
AVAILABLE DISK SELECTIONS:
		   0. c0t3d0 <SUN0424 cyl 1151 alt 2 hd 9 sec 80>
        /sbus@1,f8000000/esp@0,800000/sd@3,0
		   1. c1t0d0 <SUN0424 cyl 1151 alt 2 hd 9 sec 80>
			     /sbus@1,f8000000/QLGC,isp@1,10000/sd@0,0
Specify disk (enter its number): 1
Disk not labeled.  Label it now?  yes
format> verify
#

How to Examine a Disk Label

Examine disk label information by using the prtvtoc(1M) command. See Chapter 21, Disk Management (Overview) for a detailed description of the disk label and the information displayed by the prtvtoc command.

  1. Become superuser.

  2. Display the disk label information by using the prtvtoc command.


    # prtvtoc /dev/rdsk/device-name
    

    device-name

    Raw disk device you want to examine.  

Example--Examining a Disk Label

The following example shows the disk label information for disk /dev/rdsk/c0t0d0s0.


# prtvtoc /dev/rdsk/c0t0d0s0
* c0t0d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      36 sectors/track
*       9 tracks/cylinder
*     324 sectors/cylinder
*    1272 cylinders
*    1254 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                       First   Sector    Last	
* Partition Tag Flags  Sector   Count    Sector  Mount Directory
      0      2   00         0    37260    37259   /
      1      3   01     37260    77760   115019
      2      5   00         0   406296   406295
      6      4   00    115020   283824   398843   /usr
      7      6   00    398844     7452   406295   /export/home
#