JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Devices and File Systems     Oracle Solaris 10 8/11 Information Library
search filter icon
search icon

Document Information

About This Book

1.  Managing Removable Media (Overview)

2.  Managing Removable Media (Tasks)

3.  Accessing Removable Media (Tasks)

4.  Writing CDs and DVDs (Tasks)

5.  Managing Devices (Overview/Tasks)

6.  Dynamically Configuring Devices (Tasks)

7.  Using USB Devices (Overview)

8.  Using USB Devices (Tasks)

9.  Using InfiniBand Devices (Overview/Tasks)

10.  Managing Disks (Overview)

11.  Administering Disks (Tasks)

Administering Disks (Task Map)

Identifying Disks on a System

How to Identify the Disks on a System

Formatting a Disk

How to Determine if a Disk Is Formatted

How to Format a Disk

Displaying Disk Slices

How to Display Disk Slice Information

Creating and Examining a Disk Label

How to Label a Disk

How to Examine a Disk Label

Recovering a Corrupted Disk Label

How to Recover a Corrupted Disk Label

Adding a Third-Party Disk

12.  SPARC: Setting Up Disks (Tasks)

13.  x86: Setting Up Disks (Tasks)

14.  Configuring Oracle Solaris iSCSI Targets and Initiators (Tasks)

15.  The format Utility (Reference)

16.  Managing File Systems (Overview)

17.  Creating and Mounting File Systems (Tasks)

18.  Using The CacheFS File System (Tasks)

19.  Configuring Additional Swap Space (Tasks)

20.  Checking UFS File System Consistency (Tasks)

21.  UFS File System (Reference)

22.  Backing Up and Restoring UFS File Systems (Overview)

23.  Backing Up UFS Files and File Systems (Tasks)

24.  Using UFS Snapshots (Tasks)

25.  Restoring UFS Files and File Systems (Tasks)

26.  UFS Backup and Restore Commands (Reference)

27.  Copying Files and File Systems (Tasks)

28.  Managing Tape Drives (Tasks)

Index

Creating and Examining a Disk Label

The labeling of a disk is usually done during system installation or when you are using new disks. You might need to relabel a disk if the disk label becomes corrupted. For example, from a power failure.

The format utility attempts to automatically configure any unlabeled SCSI disk. If the format utility is able to automatically configure an unlabeled disk, it displays a message similar to the following:

    c2t3d0: configured with capacity of 136.73GB

Tip - For information on labeling multiple disks with the same disk label, see Example 11-7.


How to Label a Disk

You can use the following procedure to do the following:

If you want to put an EFI label on disk smaller than 2 terabytes, see Example 11-5.

  1. Become superuser or assume an equivalent role.
  2. Invoke the format utility.
    # format

    A numbered list of disks is displayed.

  3. Type the number of the disk that you want to label.
    Specify disk (enter its number):1

    If the format utility recognizes the disk type, the next step is to search for a backup label to label the disk. Labeling the disk with the backup label labels the disk with the correct partitioning information, the disk type, and disk geometry.

  4. Select one of the following to label the disk:
    • If the disk is unlabeled and was successfully configured, go to Step 5 to label the disk.

      The format utility will ask if you want to label the disk.

    • If the disk is labeled but you want to change the disk type, or if the format utility was not able to automatically configure the disk, proceed to Step 6 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

    The Available Drive Types menu is displayed.

  7. Select a disk type from the list of possible disk types.
    Specify disk type (enter its number)[12]: 12

    Or, select 0 to automatically configure a SCSI-2 disk.

  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. Verify the disk label.
    format> verify 
  10. Exit the format utility.
    format> q
    #

Example 11-4 Labeling a Disk

The following example shows how to automatically configure and label a 36-GB disk.

# format
AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@1c,600000/scsi@2/sd@0,0
       1. c0t1d0 <SEAGATE-ST336607LSUN36G-0307-33.92GB>
          /pci@1c,600000/scsi@2/sd@1,0
       2. c0t2d0 <SEAGATE-ST336607LSUN36G-0507-33.92GB>
          /pci@1c,600000/scsi@2/sd@2,0
       3. c0t3d0 <SEAGATE-ST336607LSUN36G-0507-33.92GB>
          /pci@1c,600000/scsi@2/sd@3,0
Specify disk (enter its number): 3
c0t3d0: configured with capacity of 33.92GB
Disk not labeled.  Label it now?  yes
format> verify
format> q
#

Example 11-5 Labeling a Disk With an EFI Label

The following example shows how to use the format -e command to label a disk with an EFI label. Remember to verify that your layered software products will continue to work on systems with EFI-labeled disks. For general information on EFI label restrictions, see Restrictions of the EFI Disk Label.

# format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c2t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@0,0
       1. c2t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@1,0
       2. c2t2d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /pci@1c,600000/scsi@2/sd@2,0
       3. c2t3d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /pci@1c,600000/scsi@2/sd@3,0
Specify disk (enter its number): 3
selecting c2t3d0
[disk formatted]
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[0]: 1
Ready to label disk, continue? yes
format> quit

Example 11-6 Change a EFI-Labeled Disk to an SMI-Labeled Disk

The following example shows how to use the format -e command to change an EFI labeled disk to an SMI-labeled disk that can be used for a ZFS root pool.

# format -e
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c2t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@0,0
       1. c2t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@1,0
       2. c2t2d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /pci@1c,600000/scsi@2/sd@2,0
       3. c2t3d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /pci@1c,600000/scsi@2/sd@3,0
Specify disk (enter its number): 3
selecting c2t0d0
[disk formatted]
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[1]: 0
Ready to label disk, continue? yes

You should also check the default partition table to ensure that it is optimal for a root pool slice, which means that the bulk of the disk space is in slice 0. See the steps below to increase the size of slice 0.

format> partition
partition> print
Current partition table (default):
Total disk cylinders available: 14085 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       1 -    13      129.19MB    (13/0/0)       264576
  1       swap    wu      14 -    26      129.19MB    (13/0/0)       264576
  2     backup    wu       0 - 14086      136.71GB    (14087/0/0) 286698624
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm      27 - 14084      136.43GB    (14058/0/0) 286108416
  7 unassigned    wm       0                0         (0/0/0)             0
  8       boot    wu       0 -     0        9.94MB    (1/0/0)         20352
  9 alternates    wm       0                0         (0/0/0)             0

partition> modify
Select partitioning base:
        0. Current partition table (default)
        1. All Free Hog
Choose base (enter number) [0]? 1

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0                0         (0/0/0)             0
  1       swap    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 14084      136.69GB    (14085/0/0) 286657920
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0
  8       boot    wu       0 -     0        9.94MB    (1/0/0)         20352
  9 alternates    wm       0                0         (0/0/0)             0

Do you wish to continue creating a new partition
table based on above table[yes]? yes
Free Hog partition[6]? 0
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]: 
Enter size of partition '7' [0b, 0c, 0.00mb, 0.00gb]: 

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       1 - 14084      136.68GB    (14084/0/0) 286637568
  1       swap    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 14084      136.69GB    (14085/0/0) 286657920
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0
  8       boot    wu       0 -     0        9.94MB    (1/0/0)         20352
  9 alternates    wm       0                0         (0/0/0)             0

Okay to make this the current partition table[yes]? yes
Enter table name (remember quotes): "c2t0d0" 
Ready to label disk, continue? yes
partition> quit
format> quit

Example 11-7 Labeling Multiple Disks

You can use the prtvtoc and fmthard commands to label multiple disks with the same disk geometry.

Use the following for loop in a script to copy a disk label from one disk and replicate it on multiple disks.

# for i in x y z
> do
> prtvtoc /dev/rdsk/cwtxdysz | fmthard -s - /dev/rdsk/cwt${i}d0s2
> done

In this example, the disk label from c2t0d0s0 is copied to four other disks.

# for i in 1 2 3 5
> do
> prtvtoc /dev/rdsk/c2t0d0s0 | fmthard -s - /dev/rdsk/c2t${i}d0s2
> done
fmthard:  New volume table of contents now in place.
fmthard:  New volume table of contents now in place.
fmthard:  New volume table of contents now in place.
fmthard:  New volume table of contents now in place.

How to Examine a Disk Label

Examine disk label information by using the prtvtoc command. For a detailed description of the disk label and the information that is displayed by the prtvtoc command, see Chapter 10, Managing Disks (Overview).

  1. Become superuser or assume an equivalent role.
  2. Display the disk label information.
    # prtvtoc /dev/rdsk/device-name

    where device-name is the raw disk device you want to examine.

Example 11-8 Examining a Disk Label

The following example shows disk label information for a disk with a VTOC label.

# prtvtoc /dev/rdsk/c2t3d0s0
* /dev/rdsk/c2t3d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*     848 sectors/track
*      24 tracks/cylinder
*   20352 sectors/cylinder
*   14089 cylinders
*   14087 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00          0 286698624 286698623
       2      5    01          0 286698624 286698623

The following example shows disk label information for a disk with an EFI label.

# prtvtoc /dev/rdsk/c2t3d0s0
* /dev/rdsk/c2t3d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*     848 sectors/track
*      24 tracks/cylinder
*   20352 sectors/cylinder
*   14089 cylinders
*   14087 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00          0 286698624 286698623
       2      5    01          0 286698624 286698623