Solaris – How to Label a Disk

0
0

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

If you want to put an EFI label on disk smaller than 2 terabytes, see the example below.

  1. Become superuser.
  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 – 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>
          /[email protected],600000/[email protected]/[email protected],0
       1. c0t1d0 <SEAGATE-ST336607LSUN36G-0307-33.92GB>
          /[email protected],600000/[email protected]/[email protected],0
       2. c0t2d0 <SEAGATE-ST336607LSUN36G-0507-33.92GB>
          /[email protected],600000/[email protected]/[email protected],0
       3. c0t3d0 <SEAGATE-ST336607LSUN36G-0507-33.92GB>
          /[email protected],600000/[email protected]/[email protected],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 – 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>
          /[email protected],600000/[email protected]/[email protected],0
       1. c2t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /[email protected],600000/[email protected]/[email protected],0
       2. c2t2d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /[email protected],600000/[email protected]/[email protected],0
       3. c2t3d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /[email protected],600000/[email protected]/[email protected],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 – 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>
          /[email protected],600000/[email protected]/[email protected],0
       1. c2t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /[email protected],600000/[email protected]/[email protected],0
       2. c2t2d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /[email protected],600000/[email protected]/[email protected],0
       3. c2t3d0 <FUJITSU-MAP3147N SUN146G-0501-136.73GB>
          /[email protected],600000/[email protected]/[email protected],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

LEAVE A REPLY

Please enter your comment!
Please enter your name here