JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 11.1 Administration: Devices and File Systems     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Managing Removable Media (Tasks)

2.  Writing CDs and DVDs (Tasks)

3.  Managing Devices (Tasks)

4.  Dynamically Configuring Devices (Tasks)

5.  Managing USB Devices (Tasks)

6.  Using InfiniBand Devices (Overview/Tasks)

7.  Managing Disks (Overview)

8.  Managing Disk Use (Tasks)

9.  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

10.  Setting Up Disks (Tasks)

11.  Configuring Storage Devices With COMSTAR (Tasks)

12.  Configuring and Managing the Oracle Solaris Internet Storage Name Service (iSNS)

13.  The format Utility (Reference)

14.  Managing File Systems (Overview)

15.  Creating and Mounting File Systems (Tasks)

16.  Configuring Additional Swap Space (Tasks)

17.  Copying Files and File Systems (Tasks)

18.  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

How to Label a Disk

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

  1. Become an administrator.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  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 9-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 9-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 or an SMI (VTOC) 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 9-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.

On an x86 based system, you will first have to change the EFI fdisk partition to a Solaris partition. For example:

# format -e
select disk ...
format> fdisk
FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
             Total disk size is 17833 cylinders
             Cylinder size is 16065 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1                 EFI               0  17833    17834    100




SELECT ONE OF THE FOLLOWING:
   1. Create a partition
   2. Specify the active partition
   3. Delete a partition
   4. Change between Solaris and Solaris2 Partition IDs
   5. Edit/View extended partitions
   6. Exit (update disk configuration and exit)
   7. Cancel (exit without updating disk configuration)
Enter Selection: 3
Specify the partition number to delete (or enter 0 to exit): 1
This will make all files and 
programs in this partition inaccessible (type "y" or "n"). y
Enter Selection: 1
Select the partition type to create:
   1=SOLARIS2   2=UNIX      3=PCIXOS     4=Other        5=DOS12
   6=DOS16      7=DOSEXT    8=DOSBIG     9=DOS16LBA     A=x86 Boot
   B=Diagnostic C=FAT32     D=FAT32LBA   E=DOSEXTLBA    F=EFI (Protective)
   G=EFI_SYS    0=Exit? 1
Specify the percentage of disk to use for this partition
(or type "c" to specify the size in cylinders). 100
Should this become the active partition? If yes, it  will be activated
each time the computer is reset or turned on.
Please type "y" or "n". y
Enter Selection: 6
Partition 1 is now the active partition.

On a SPARC based system, follow these steps:

# 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

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 7, Managing Disks (Overview).

  1. Become an administrator.

    For more information, see How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Display the disk label information.
    # prtvtoc /dev/rdsk/device-name

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

Example 9-7 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 root pool disk with an EFI label:

# prtvtoc /dev/dsk/c7t0d0s1
* /dev/dsk/c7t0d0s1 partition map
*
* Dimensions:
*     512 bytes/sector
* 156301488 sectors
* 156301421 accessible sectors
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*       First     Sector    Last
*       Sector     Count    Sector
*          34       222       255
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0     24    00        256    524288    524543
       1      4    00     524544 155760527 156285070
       8     11    00  156285071     16384 156301454
~#

The following example shows disk label information for a non-root pool disk with an EFI label:

# prtvtoc /dev/dsk/c8t3d0 
* /dev/dsk/c8t3d0 partition map
*
* Dimensions:
*     512 bytes/sector
* 143374738 sectors
* 143374671 accessible sectors
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*       First     Sector    Last
*       Sector     Count    Sector
*          34       222       255
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      4    00        256 143358065 143358320
       8     11    00  143358321     16384 143374704