<chapter id="disksprep-31030"><title>Administering Disks (Tasks)</title><highlights><para>This chapter contains disk administration procedures. Many procedures
described in this chapter are optional if you are already familiar with how
disks are managed on systems running the <trademark>Solaris</trademark> OS.</para><para>For information on the procedures associated with administering disks,
see <olink targetptr="disksprep-1" remap="internal">Administering Disks (Task Map)</olink>.</para><para>For overview information about disk management, see <olink targetptr="disksconcepts-29477" remap="internal">Chapter&nbsp;10, Managing Disks (Overview)</olink>.</para>
</highlights><sect1 id="disksprep-1"><title>Administering Disks (Task Map)</title><informaltable frame="all"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec3" colwidth="33*"/><colspec colname="colspec4" colwidth="33*"/><colspec colname="colspec5" colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Identify the disks on a system.</para>
</entry><entry><para>If you are not sure of the types of disks on a system, use the <command>format</command> utility to identify the disk types.</para>
</entry><entry><para><olink targetptr="disksprep-24293" remap="internal">How to Identify the Disks on a System</olink></para>
</entry>
</row><row><entry rowsep="0"><para>Format the disk.</para>
</entry><entry rowsep="0"><para>Determine whether a disk is already formatted by using the <command>format</command> utility.</para>
</entry><entry rowsep="0"><para><olink targetptr="disksprep-37081" remap="internal">How to Determine if a Disk Is Formatted</olink></para>
</entry>
</row><row><entry rowsep="1"><para></para>
</entry><entry rowsep="1"><para>In most cases, disks are already formatted. Use the <command>format</command> utility
if you need to format a disk.</para>
</entry><entry rowsep="1"><para><olink targetptr="disksprep-24584" remap="internal">How to Format a Disk</olink></para>
</entry>
</row><row><entry><para>Display slice information.</para>
</entry><entry><para>Display slice information by using the <command>format</command> utility. </para>
</entry><entry><para><olink targetptr="disksprep-23207" remap="internal">How to Display Disk Slice Information</olink></para>
</entry>
</row><row><entry><para>Label the disk.</para>
</entry><entry><para>Create the disk label by using the <command>format</command> utility. </para>
</entry><entry><para><olink targetptr="disksprep-32432" remap="internal">How to Label a Disk</olink></para>
</entry>
</row><row><entry><para>Examine the disk label.</para>
</entry><entry><para>Examine the disk label by using the <command>prtvtoc</command> command. </para>
</entry><entry><para><olink targetptr="disksprep-15875" remap="internal">How to Examine a Disk Label</olink></para>
</entry>
</row><row><entry><para>Recover a corrupted disk label.</para>
</entry><entry><para>You can attempt to recover a disk label that was damaged due to a system
or power failure.</para>
</entry><entry><para><olink targetptr="disksprep-22071" remap="internal">How to Recover a Corrupted Disk Label</olink></para>
</entry>
</row><row><entry><para>Create a <filename>format.dat</filename> entry.</para>
</entry><entry><para>Create a <filename>format.dat</filename> entry to support a third-party
 disk.</para>
</entry><entry><para><olink targetptr="disksprep-17927" remap="internal">How to Create a format.dat Entry</olink></para>
</entry>
</row><row><entry><para>Automatically configure a SCSI disk.</para>
</entry><entry><para>You can automatically configure a SCSI disk with the SCSI-2 specification
for disk device mode sense pages even if the specific drive type is not listed
in the <filename>/etc/format.dat</filename> file.</para>
</entry><entry><para><olink targetptr="disksprep-24067" remap="internal">How to Automatically Configure a
SCSI Drive</olink></para>
</entry>
</row><row><entry><para>Identify a defective disk sector.</para>
</entry><entry><para>Identify a defective disk sector by using the <command>format</command> utility. </para>
</entry><entry><para><olink targetptr="disksprep-27270" remap="internal">How to Identify a Defective Sector
by Using Surface Analysis</olink></para>
</entry>
</row><row><entry><para>If necessary, fix a defective disk sector.</para>
</entry><entry><para>Fix a defective disk sector by using the <command>format</command> utility. </para>
</entry><entry><para><olink targetptr="disksprep-31929" remap="internal">How to Repair a Defective Sector</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="disksprep-3"><title>Identifying Disks on a System</title><para>Use the <command>format</command> utility to discover the types
of disks that are connected to a system. You can also use the <command>format</command> utility
to verify that a disk is known to the system. For detailed information on
using the <command>format</command> utility, see <olink targetptr="disksformat-15833" remap="internal">Chapter&nbsp;15, The format Utility (Reference)</olink>. </para><task id="disksprep-24293"><title>How to Identify the Disks on a System</title><procedure><step><para>Become superuser or assume an equivalent role.</para><para>Roles
contain authorizations and privileged commands. For more information about
roles, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para>
</step><step id="disksprep-step-6"><para>Identify
the disks that are recognized on the system by using the <command>format</command> utility. </para><screen># <userinput>format</userinput></screen><para>The format utility displays a list of disks that it recognizes under <literal>AVAILABLE DISK SELECTIONS</literal>.</para>
</step>
</procedure><example id="fncqj"><title>Identifying the Disks on a System</title><para>The following example shows <command>format</command> command output
is from a system with one disk.</para><screen># <userinput>format</userinput>
AVAILABLE DISK SELECTIONS:
 0. c0t1d0 &lt;FUJITSU  MAN3367M SUN36G  1804 43d671f>
    /pci@1f,0/pci@1,1/scsi@2/sd@1,0</screen><para>The output associates a disk's physical and logical device name to the
disk's marketing name, which appears in angle brackets <literal>&lt;></literal>.
See the example below. This method is an easy way to identify which logical
device names represent the disks that are connected to your system. For a
description of logical and physical device names, see <olink targetptr="devaccess-29390" remap="internal">Device Naming Conventions</olink>.</para><para>The following example uses a wildcard to display the four disks that
are connected to a second controller.</para><screen># <userinput>format /dev/rdsk/c2*</userinput>
AVAILABLE DISK SELECTIONS:
       0. /dev/rdsk/c2t10d0s0 &lt;SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
          /sbus@3,0/SUNW,fas@3,8800000/sd@a,0
       1. /dev/rdsk/c2t11d0s0 &lt;SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
          /sbus@3,0/SUNW,fas@3,8800000/sd@b,0
       2. /dev/rdsk/c2t14d0s0 &lt;SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@3,0/SUNW,fas@3,8800000/sd@e,0
       3. /dev/rdsk/c2t15d0s0 &lt;SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@3,0/SUNW,fas@3,8800000/sd@f,0
Specify disk (enter its number): </screen><para>The following example shows how to identify the disks on a SPARC based
system.</para><screen># <userinput>format</userinput>
0. c0t1d0 &lt;FUJITSU  MAN3367M SUN36G  1804 43d671f>
   /pci@1f,0/pci@1,1/scsi@2/sd@1,0
Specify disk (enter its number): </screen><para>The output identifies that disk 0 (target 1) is connected to the second
SCSI host adapter (<literal>scsi@2</literal>), which is connected to the second
PCI interface (<literal>/pci@1f0/pci@1,1...</literal>). The output also associates
both the physical and logical device name to the disk's marketing name, <literal>SUN36G</literal>.</para><para>The following example shows how to identify the disks on an x86 based
system.</para><screen># <userinput>format</userinput>
AVAILABLE DISK SELECTIONS:
 0. c0d0 &lt;DEFAULT cyl 615 alt 2 hd 64 sec 63>
     /pci@0,0/pci-ide@7,1/ata@0/cmdk@0,0
 1. c0d1 &lt;DEFAULT cyl 522 alt 2 hd 32 sec 63>
     /pci@0,0/pci-ide@7,1/ata@0/cmdk@1,0
 2. c1d0 &lt;DEFAULT cyl 817 alt 2 hd 256 sec 63>
     /pci@0,0/pci-ide@7,1/ata@1/cmdk@0,0
Specify disk (enter its number):  </screen><para>The output shows that disk 0 is connected to the first PCI host
adapter (<literal>pci-ide@7..</literal>.), which is connected to the ATA interface
(<literal>ata...</literal>). The <command>format</command> output on an x86 based
system does not identify disks by their marketing names.</para>
</example><taskrelated-custom><title>If the <command>format</command> Utility Does Not
Recognize a Disk ...</title><itemizedlist><listitem><para>Go to <olink targetptr="diskssadd-16103" remap="internal">Chapter&nbsp;12,
SPARC: Adding a Disk (Tasks)</olink> or <olink targetptr="disksxadd-38159" remap="internal">Chapter&nbsp;13,
x86: Adding a Disk (Tasks)</olink>.</para>
</listitem><listitem><para>Go to <olink targetptr="disksprep-12536" remap="internal">Creating a format.dat
Entry</olink>.</para>
</listitem><listitem><para>Go to <olink targetptr="disksprep-32432" remap="internal">How to Label a Disk</olink>.</para>
</listitem><listitem><para>Connect the disk to the system by using your disk hardware
documentation.</para>
</listitem>
</itemizedlist>
</taskrelated-custom>
</task>
</sect1><sect1 id="disksprep-10"><title>Formatting a Disk</title><para>Disks are typically formatted
by the manufacturer or reseller. They usually do not need to be reformatted
when you install the drive. </para><para>A disk must be formatted before you can do the following:</para><itemizedlist><listitem><para>Write data to the disk. However, most disks are already formatted.</para>
</listitem><listitem><para>Use the Solaris installation utility to install the system.</para>
</listitem>
</itemizedlist><caution><para>Formatting a disk is a destructive process because it overwrites
data on the disk. For this reason, disks are usually formatted only by the
manufacturer or reseller. If you think disk defects are the cause of recurring
problems, you can use the <command>format</command> utility to do a surface
analysis. However, be careful to use only the commands that do not destroy
data.</para>
</caution><task id="disksprep-37081"><title>How to Determine if a Disk Is Formatted</title><procedure><step id="disksprep-step-12"><para>Become superuser or assume an equivalent
role.</para>
</step><step id="disksprep-step-13"><para>Invoke the <command>format</command> utility.</para><screen># <userinput>format</userinput></screen><para>A numbered list of disks is displayed.</para>
</step><step id="disksprep-step-14"><para>Type the number of the disk that you want
to check. </para><screen>Specify disk (enter its number): <userinput>0</userinput></screen>
</step><step id="disksprep-step-106"><para>Verify
that the disk you chose is formatted by noting the following message:</para><screen>[disk formatted]</screen>
</step>
</procedure><example id="fncqk"><title>Determining if a Disk Is Formatted</title><para>The following example shows that disk <literal>c1t0d0</literal> is formatted.</para><screen># <userinput>format /dev/rdsk/c1*</userinput>
AVAILABLE DISK SELECTIONS:
       0. /dev/rdsk/c1t0d0s0 &lt;SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@2,0/QLGC,isp@2,10000/sd@0,0
       1. /dev/rdsk/c1t1d0s0 &lt;SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@2,0/QLGC,isp@2,10000/sd@1,0
       2. /dev/rdsk/c1t8d0s0 &lt;SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@2,0/QLGC,isp@2,10000/sd@8,0
       3. /dev/rdsk/c1t9d0s0 &lt;SUN18G cyl 7506 alt 2 hd 19 sec 248>
          /sbus@2,0/QLGC,isp@2,10000/sd@9,0
Specify disk (enter its number): <userinput>0</userinput>
selecting /dev/rdsk/c1t0d0s0
[disk formatted]</screen>
</example>
</task><task id="disksprep-24584"><title>How to Format a Disk</title><procedure><step id="disksprep-step-18"><para>Become superuser or assume an equivalent
role.</para>
</step><step id="disksprep-step-19"><para>Invoke the <command>format</command> utility.</para><screen># <userinput>format</userinput></screen><para>A numbered list of disks is displayed.</para>
</step><step id="disksprep-step-20"><para>Type the number of the disk that you want
to format.</para><screen>Specify disk (enter its number): <userinput>0</userinput></screen><caution><para>Do not select the system disk. If you format your system disk,
you delete the OS and any data on this disk.</para>
</caution>
</step><step id="disksprep-step-21"><para>To begin formatting the disk, type <command>format</command> at the <literal>format></literal> prompt. Confirm the command by
typing <command>y</command>.</para><screen>format> <userinput>format</userinput>
Ready to format.  Formatting cannot be interrupted
and takes 23 minutes (estimated). Continue? <userinput>yes</userinput></screen>
</step><step id="disksprep-step-107"><para>Verify that the disk format was successful
by noting the following messages:</para><screen>Beginning format. The current time Tue ABC xx xx:xx:xx xxxx

Formatting...
done

Verifying media...
        pass 0 - pattern = 0xc6dec6de
   2035/12/18  

        pass 1 - pattern = 0x6db6db6d
   2035/12/18  

Total of 0 defective blocks repaired.</screen>
</step><step><para>Exit the <command>format</command> utility.</para><screen>format> <userinput>quit</userinput></screen>
</step>
</procedure><example id="fncql"><title>Formatting a Disk</title><para>The following example shows how to format the disk <literal>c0t6d0</literal>. </para><screen># <userinput>format</userinput>
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0 &lt;SUNW18G cyl 7506 alt 2 hd 19 sec 248
          /pci@1f,0/pci@1,1/scsi@2/sd@0,0
       1. c0t1d0 &lt;FUJITSU  MAN3367M SUN36G  1804 43d671f>
          /pci@1f,0/pci@1,1/scsi@2/sd@1,0
       2. c0t2d0 &lt;FUJITSU  MAN3367M SUN36G  1804 43d671f>
          /pci@1f,0/pci@1,1/scsi@2/sd@2,0
       3. c0t3d0 &lt;FUJITSU  MAN3367M SUN36G  1804 43d671f>
          /pci@1f,0/pci@1,1/scsi@2/sd@3,0
       4. c0t4d0 &lt;FUJITSU  MAN3367M SUN36G  1804 43d671f>
          /pci@1f,0/pci@1,1/scsi@2/sd@4,0
       5. c0t5d0 &lt;FUJITSU  MAN3367M SUN36G  1804 43d671f>
          /pci@1f,0/pci@1,1/scsi@2/sd@5,0
       6. c0t6d0 &lt;FUJITSU  MAN3367M SUN36G  1804 43d671f>
          /pci@1f,0/pci@1,1/scsi@2/sd@6,0
Specify disk (enter its number): <userinput>6</userinput>
selecting c0t6d0
[disk formatted]
format> <userinput>format</userinput>
Ready to format.  Formatting cannot be interrupted
and takes 332 minutes (estimated). Continue? <userinput>y</userinput>
Beginning format. The current time is Wed Jan  7 16:16:05 2004

Formatting...
   99% complete (00:00:21 remaining) done

Verifying media...
        pass 0 - pattern = 0xc6dec6de
   71132922  

        pass 1 - pattern = 0x6db6db6d
   71132922  

Total of 0 defective blocks repaired.
format> <userinput>quit</userinput></screen>
</example>
</task>
</sect1><sect1 id="disksprep-24"><title>Displaying Disk Slices</title><para>You can use the <command>format</command> utility to check whether a disk has the appropriate disk slices.
If you determine that a disk does not contain the slices you want to use,
use the <command>format</command> utility to re-create them and label the
disk. For information on creating disk slices, see <olink targetptr="diskssadd-43616" remap="internal">How to Create Disk Slices and Label a Disk</olink> or <olink targetptr="disksxadd-33190" remap="internal">How to Create Disk Slices and Label a Disk</olink>.</para><note><para>The <command>format</command> utility uses the term <emphasis>partition</emphasis> instead of <emphasis>slice</emphasis>.</para>
</note><task id="disksprep-23207"><title>How to Display Disk Slice Information</title><procedure><step id="disksprep-step-26"><para>Become superuser or assume an equivalent
role.</para>
</step><step id="disksprep-step-27"><para>Invoke the <command>format</command> utility.</para><screen># <userinput>format</userinput></screen><para>A numbered list of disks is displayed.</para>
</step><step id="disksprep-step-28"><para>Type the number of the disk for which you
want to display slice information.</para><screen>Specify disk (enter its number):<userinput>1</userinput></screen>
</step><step id="disksprep-step-29"><para>Select the <literal>partition</literal> menu.</para><screen>format> <userinput>partition</userinput> </screen>
</step><step id="disksprep-step-30"><para>Display the slice information for the selected
disk.</para><screen>partition> <userinput>print</userinput></screen>
</step><step id="disksprep-step-31"><para>Exit the <command>format</command> utility.</para><screen>partition> <userinput>q</userinput>
format> <userinput>q</userinput>
#</screen>
</step><step id="disksprep-step-108"><para>Verify the displayed slice information
by identifying specific slice tags and slices.</para><para>If the screen output
shows that no slice sizes are assigned, the disk probably does not have slices.</para>
</step>
</procedure><example id="fncqm"><title>Displaying Disk Slice Information</title><para>The following example displays slice information for a disk with a VTOC
label. </para><screen># <userinput>format</userinput>
Searching for disks...done
Specify disk (enter its number):<userinput>1</userinput>
Selecting c0t0d0
format> <userinput>partition</userinput>
partition> <userinput>print</userinput>
Current partition table (original):
Total disk cylinders available: 8892 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm    1110 - 4687        1.61GB    (0/3578/0) 3381210
  1       swap    wu       0 - 1109      512.00MB    (0/1110/0) 1048950
  2     backup    wm       0 - 8891        4.01GB    (0/8892/0) 8402940
  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 unassigned    wm       0               0         (0/0/0)          0
  7       home    wm    4688 - 8891        1.89GB    (0/4204/0) 3972780
partition> <userinput>q</userinput>
format> <userinput>q</userinput>
#</screen><para>For a detailed description of the slice information in these examples,
see <olink targetptr="disksconcepts-29477" remap="internal">Chapter&nbsp;10, Managing Disks
(Overview)</olink>.</para><para>The following example shows the slice information for a disk with an
EFI label.</para><screen># <userinput>format</userinput>
Searching for disks...done
Specify disk (enter its number): <userinput>9</userinput>
selecting c4t1d0
[disk formatted]
format> <userinput>partition</userinput>
partition> <userinput>print</userinput>
Current partition table (original):
partition> <userinput>q</userinput>
format> <userinput>q</userinput>
Part      Tag    Flag     First Sector          Size          Last Sector
  0       root    wm                34       300.00GB           629145633
  1        usr    wm         629145634       300.00GB           1258291233
  2 unassigned    wm                 0            0                0    
  3 unassigned    wm                 0            0                0    
  4 unassigned    wm                 0            0                0    
  5 unassigned    wm                 0            0                0    
  6        usr    wm        1258291234       628.77GB           2576924637
  8   reserved    wm        2576924638         8.00MB           2576941021    </screen>
</example>
</task>
</sect1><sect1 id="disksprep-34"><title>Creating and Examining a Disk Label</title><para>The labeling of a disk is usually done during system installation or
when you are creating new disk slices. You might need to relabel a disk if
the disk label becomes corrupted. For example, from a power failure.</para><para>The <command>format</command> utility attempts to automatically configure
any unlabeled SCSI disk. If the <command>format</command> utility is able
to automatically configure an unlabeled disk, it displays a message similar
to the following: </para><screen>	c0t0d1: configured with capacity of 4.00GB</screen><tip><para>For information on labeling multiple disks with the same disk label,
see <olink targetptr="disksprep-103" remap="internal">Labeling Multiple Disks by Using the
prtvtoc and fmthard Commands</olink>.</para>
</tip><task id="disksprep-32432"><title>How to Label a Disk</title><tasksummary><para>You can use the following procedure to do the following:</para><itemizedlist><listitem><para>Label a disk with a VTOC label or a disk greater than 1 terabyte
with an EFI label.</para>
</listitem><listitem><para>Label a disk that is greater than 1 terabyte with an EFI label.</para>
</listitem>
</itemizedlist><para>If you want to put an EFI label on disk smaller than 1 terabyte, see <olink targetptr="disksprep-116" remap="internal">Example&nbsp;11&ndash;6</olink>.</para>
</tasksummary><procedure><step id="disksprep-step-36"><para>Become superuser or assume an equivalent
role.</para>
</step><step id="disksprep-step-37"><para>Invoke the <command>format</command> utility.</para><screen># <userinput>format</userinput></screen><para>A numbered list of disks is displayed.</para>
</step><step id="disksprep-step-38"><para>Type the number of the disk that you want
to label.</para><screen>Specify disk (enter its number):<userinput>1</userinput></screen><para>If the <command>format</command> 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.</para>
</step><step id="disksprep-step-39"><para>Select one of the following to label the
disk:</para><itemizedlist><listitem><para>If the disk is unlabeled and was successfully configured,
go to Step 5 to label the disk.</para><para>The <command>format</command> utility
will ask if you want to label the disk.</para>
</listitem><listitem><para>If the disk is labeled but you want to change the disk type,
or if the <command>format</command> utility was not able to automatically
configure the disk, proceed to Step 6 to set the disk type and label the disk.</para>
</listitem>
</itemizedlist>
</step><step id="disksprep-step-40"><para>Label the disk by typing <command>y</command> at
the <literal>Label it now?</literal> prompt.</para><screen>Disk not labeled. Label it now? <userinput>y</userinput></screen><para>The disk is now labeled. Go to step 10 to exit the <command>format</command> utility.</para>
</step><step id="disksprep-step-41"><para>Enter <command>type</command> at the <literal>format></literal> prompt.</para><screen>format> <userinput>type</userinput></screen><para>The Available Drive Types menu is displayed.</para>
</step><step id="disksprep-step-42"><para>Select a disk type from the list of possible
disk types.</para><screen>Specify disk type (enter its number)[12]: <userinput>12</userinput></screen><para>Or, select <literal>0</literal> to automatically configure a SCSI-2
disk. For more information, see <olink targetptr="disksprep-24067" remap="internal">How to
Automatically Configure a SCSI Drive</olink>.</para>
</step><step id="disksprep-step-43"><para>Label the disk. If the disk is not labeled,
the following message is displayed.</para><screen>Disk not labeled. Label it now? <userinput>y</userinput></screen><para>Otherwise, you are prompted with this message:</para><screen>Ready to label disk, continue? <userinput>y</userinput></screen>
</step><step id="disksprep-step-109"><para>Verify the disk label.</para><screen>format> <userinput>verify</userinput> </screen>
</step><step id="disksprep-step-44"><para>Exit the <command>format</command> utility.</para><screen>format> <userinput>q</userinput>
#</screen>
</step>
</procedure><example id="fncqo"><title>Labeling a Disk</title><para>The following example shows how to automatically configure and
label a 1.05-Gbyte disk. </para><screen># <userinput>format</userinput>
	c1t0d0: configured with capacity of 1002.09MB
 
AVAILABLE DISK SELECTIONS:
	  0. c0t3d0 &lt;SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
     /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
	  1. c1t0d0 &lt;SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
     /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
Specify disk (enter its number): <userinput>1</userinput>
Disk not labeled.  Label it now?  <userinput>yes</userinput>
format> <userinput>verify</userinput>
format> <userinput>q</userinput>
#</screen>
</example><example id="disksprep-116"><title>Labeling a Disk Less Than 1 Terabyte with an EFI Label</title><para>The following example shows how to use the <command>format</command> <option>e</option> command to label a disk that is less than 1 terabyte 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 <olink targetptr="disksconcepts-17" remap="internal">Restrictions of
the EFI Disk Label</olink>.</para><screen># <userinput>format -e</userinput>
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       1. c1t0d0 &lt;SUNW18g cyl 7506 alt 2 hd 19 sec 248>
          /sbus@2,0/QLGC,isp@2,10000/sd@0,0
       2. c1t1d0 &lt;SUNW18g cyl 7506 alt 2 hd 19 sec 248>
          /sbus@2,0/QLGC,isp@2,10000/sd@1,0
       3. c1t8d0 &lt;SUNW18g cyl 7506 alt 2 hd 19 sec 248>
          /sbus@2,0/QLGC,isp@2,10000/sd@8,0
       4. c1t9d0 &lt;SUNW18g cyl 7506 alt 2 hd 19 sec 248>
          /sbus@2,0/QLGC,isp@2,10000/sd@9,0
Specify disk (enter its number): <userinput>4</userinput>
selecting c1t9d0
[disk formatted]
format> <userinput>label</userinput>
[0] SMI Label
[1] EFI Label
Specify Label type[0]: <userinput>1</userinput>
Ready to label disk, continue? <userinput>yes</userinput>
format> <userinput>quit</userinput></screen>
</example>
</task><task id="disksprep-15875"><title>How to Examine a Disk Label</title><tasksummary><para>Examine disk label information by using the <command>prtvtoc</command> command.
For a detailed description of the disk label and the information that is displayed
by the <command>prtvtoc</command> command, see <olink targetptr="disksconcepts-29477" remap="internal">Chapter&nbsp;10, Managing Disks (Overview)</olink>.
 </para>
</tasksummary><procedure><step id="disksprep-step-48"><para>Become superuser or assume an equivalent
role.</para>
</step><step id="disksprep-step-49"><para>Display the disk label information. </para><screen># <userinput>prtvtoc /dev/rdsk/</userinput><replaceable>device-name</replaceable></screen><para>where <replaceable>device-name</replaceable> is the raw disk device
you want to examine. </para>
</step>
</procedure><example id="fncqn"><title>Examining a Disk Label</title><para>The following example
shows disk label information for a disk with a VTOC label.</para><screen># <userinput>prtvtoc /dev/rdsk/c0t0d0s0</userinput>
* /dev/rdsk/c0t0d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*      15 tracks/cylinder
*     945 sectors/cylinder
*    8894 cylinders
*    8892 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00    1048950   3381210   4430159   /
       1      3    01          0   1048950   1048949
       2      5    00          0   8402940   8402939
       7      8    00    4430160   3972780   8402939   /export/home</screen><para>The following example shows disk label information for a disk with an
EFI label.</para><screen># <userinput>prtvtoc /dev/rdsk/c3t1d0s0</userinput>
* /dev/rdsk/c3t1d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
* 2479267840 sectors
* 2479267773 accessible sectors
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First      Sector       Last
* Partition  Tag  Flags    Sector     Count        Sector  Mount Directory
       0      2    00          34      262144      262177
       1      3    01      262178      262144      524321
       6      4    00      524322  2478727100  2479251421
       8     11    00  2479251422       16384  2479267805</screen>
</example>
</task>
</sect1><sect1 id="disksprep-52"><title>Recovering a Corrupted Disk Label</title><para>Sometimes, a power
or system failure causes a disk's label to become unrecognizable. A corrupted
disk label doesn't always mean that the slice information or the disk's data
must be re-created or restored. </para><para>The first step to recovering a corrupted disk label is to label the
disk with the correct geometry and disk type information. You can complete
this step through the normal disk labeling method, by using either automatic
configuration or manual disk type specification.</para><para>If the <command>format</command> 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.</para><task id="disksprep-22071"><title>How to Recover a Corrupted Disk Label</title><procedure><step id="disksprep-step-54"><para>Boot the system to single-user mode.</para><para>If necessary, boot the system from a local CD-ROM or the network in
single-user mode to access the disk. </para><para>See <olink targetdoc="sysadv1" targetptr="hbsparcboot-79782" remap="external">Chapter 10, <citetitle remap="chapter">Booting a System (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink> or <olink targetdoc="sysadv1" targetptr="hbx86boot-68676" remap="external">Chapter 12, <citetitle remap="chapter">Booting a Solaris System With GRUB (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink> for
information on booting the system.</para>
</step><step id="disksprep-step-55"><para>Relabel the disk. </para><screen># <userinput>format</userinput></screen><para>The <command>format</command> utility attempts to automatically configure
any unlabeled SCSI disk. If the <command>format</command> utility is able
to configure the unlabeled and corrupted disk, it will display this message:</para><screen>c<replaceable>w</replaceable>t<replaceable>x</replaceable>d<replaceable>y</replaceable>: configured with capacity of <replaceable>abc</replaceable>MB</screen><para>The <command>format</command> utility then displays a numbered list
of disks on the system.</para>
</step><step id="disksprep-step-56"><para>Type the number of the disk that you need
to recover.</para><screen>Specify disk (enter its number): <userinput>1</userinput></screen>
</step><step id="disksprep-step-57"><para>Select one of the following to determine
how to label the disk.</para><itemizedlist><listitem><para>If the disk was configured successfully, follow Steps 5 and
6. Then go to step 12.</para>
</listitem><listitem><para>If the disk was not configured successfully, follow Steps
7&ndash;11. Then go to step 12.</para>
</listitem>
</itemizedlist>
</step><step id="disksprep-step-58"><para>Search for the backup label.</para><screen>format> <userinput>verify</userinput>
Warning: Could not read primary label.
Warning: Check the current partitioning and 'label' the disk or 
use the 'backup' command.
Backup label contents:
Volume name = &lt;        >
ascii name  = &lt;SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
pcyl        = 2038
ncyl        = 2036
acyl        =    2
nhead       =   14
nsect       =   72
Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0 -  300      148.15MB    (301/0/0)   303408
  1       swap    wu     301 -  524      110.25MB    (224/0/0)   225792
  2     backup    wm       0 - 2035     1002.09MB    (2036/0/0) 2052288
  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     525 - 2035      743.70MB    (1511/0/0) 1523088
  7 unassigned    wm       0               0         (0/0/0)          0</screen>
</step><step id="disksprep-step-59"><para>If the <command>format</command> utility
was able to find a backup label and the backup label contents appear satisfactory,
use the <command>backup</command> command to label the disk with the backup
label.</para><screen>format> <userinput>backup</userinput>
Disk has a primary label, still continue? <userinput>y</userinput>
 
Searching for backup labels...found.
Restoring primary label</screen><para>The disk label has been recovered. Go to Step 12.</para>
</step><step id="disksprep-step-60"><para>If the <command>format</command> utility
was not able to automatically configure the disk, specify the disk type by
using the <command>type</command> command.</para><screen>format> <userinput>type</userinput></screen><para>The Available Drives Type menu is displayed.</para>
</step><step id="disksprep-step-61"><para>Select <command>0</command> to automatically
configure the disk. Or, select a disk type from the list of possible disk
types.</para><screen>Specify disk type (enter its number)[12]: <userinput>12</userinput></screen>
</step><step id="disksprep-step-62"><para>If the disk was successfully configured,
reply with <command>no</command> when the <command>format</command> utility
asks if you want to label the disk.</para><screen>Disk not labeled.  Label it now?  <userinput>no</userinput></screen>
</step><step id="disksprep-step-63"><para>Use the <command>verify</command> command
to search for backup labels.</para><screen>format> <userinput>verify</userinput>
Warning: Could not read primary label.
Warning: Check the current partitioning and 'label' the disk
or use the 'backup' command.
.
.
.</screen>
</step><step id="disksprep-step-64"><para>If the <command>format</command> utility
was able to find a backup label and the backup label contents appear satisfactory,
use the <command>backup</command> command to label the disk with the backup
label.</para><screen>format> <userinput>backup</userinput>
Disk has a primary label, still continue? <userinput>y</userinput>
Searching for backup labels...found.
Restoring primary label</screen><para>The disk label has been recovered.</para>
</step><step id="disksprep-step-65"><para>Exit the <command>format</command> utility.</para><screen>format> <userinput>q</userinput></screen>
</step><step id="disksprep-step-66"><para>Verify the file systems on the recovered
disk by using the <command>fsck</command> command.</para><para>For information
on using the <command>fsck</command> command, see <olink targetptr="fstroublefsck-61446" remap="internal">Chapter&nbsp;21, Checking UFS File System
Consistency (Tasks)</olink>.</para>
</step>
</procedure>
</task>
</sect1><sect1 id="disksprep-67"><title>Adding a Third-Party Disk</title><para>The Solaris OS supports many third-party disks. However, for the disk
to be recognized, you might need to supply either a device driver, a <filename>format.dat</filename> entry, or both. Other options for adding disks are as follows:</para><itemizedlist><listitem><para>If you are adding a SCSI disk, you might to try the <command>format</command> utility's automatic configuration feature. For more information,
see <olink targetptr="disksprep-72" remap="internal">Automatically Configuring SCSI Disk Drives</olink>.</para>
</listitem><listitem><para>You might try hot-plugging a PCI, SCSI, or USB disk. For more
information, see <olink targetptr="devconfig-27900" remap="internal">Chapter&nbsp;5, Managing
Devices (Overview/Tasks)</olink>.</para>
</listitem>
</itemizedlist><para>If the third-party disk is designed to work with standard SunOS compatible
device drivers, then the creation of an appropriate <filename>format.dat</filename> entry
should suffice to allow the disk to be recognized by the <command>format</command> utility.
In other cases, you need to load a third-party device driver to support the
disk.</para><note><para>Sun cannot guarantee that its <command>format</command> utility
will work properly with all third-party disk drivers. If the disk driver is
not compatible with the Solaris <command>format</command> utility, the disk
drive vendor should supply you with a custom disk formatting program.</para>
</note><para>This section discusses what to do if some of this software support is
missing. Typically, you discover that software support is missing when you
invoke the <command>format</command> utility and find that the disk type is
not recognized.</para><para>Supply the missing software as described in this section. Then, refer
to the appropriate configuration procedure for adding system disks or secondary
disks in <olink targetptr="diskssadd-16103" remap="internal">Chapter&nbsp;12, SPARC: Adding
a Disk (Tasks)</olink> or <olink targetptr="disksxadd-38159" remap="internal">Chapter&nbsp;13,
x86: Adding a Disk (Tasks)</olink>.</para><sect2 id="disksprep-12536"><title>Creating a <filename>format.dat</filename> Entry</title><para>Unrecognized disks cannot be formatted without precise information about
the disk's geometry and operating parameters. This information is supplied
in the <filename>/etc/format.dat</filename> file. </para><note><para>SCSI-2 disks do not require a <filename>format.dat</filename> entry.
The <filename>format</filename> utility automatically configures the SCSI-2
drivers if the disks are powered on during a reconfiguration boot. For step-by-step
instructions on configuring a SCSI disk drive automatically, see <olink targetptr="disksprep-24067" remap="internal">How to Automatically Configure a SCSI Drive</olink>.</para>
</note><para>If your disk is unrecognized, use a text editor to create an entry in <filename>format.dat</filename> for the disk. You need to gather all the pertinent technical
specifications about the disk and its controller before you start. This information
should have been provided with the disk. If not, contact the disk manufacturer
or your supplier.</para>
</sect2><task id="disksprep-17927"><title>How to Create a <filename>format.dat</filename> Entry</title><procedure><step id="disksprep-step-69"><para>Become superuser or assume an equivalent role.</para>
</step><step id="disksprep-step-70"><para>Make a copy of the <filename>/etc/format.dat</filename> file.</para><screen># <userinput>cp /etc/format.dat /etc/format.dat.gen</userinput></screen>
</step><step id="disksprep-step-71"><para>Modify the <filename>/etc/format.dat</filename> file
to include an entry for the third-party disk.</para><para>Use the <filename>format.dat</filename> information that is described in <olink targetptr="disksformat-15833" remap="internal">Chapter&nbsp;15, The format Utility (Reference)</olink>. </para><para>Also,
use the disk's hardware product documentation to gather the required information.</para>
</step>
</procedure>
</task>
</sect1><sect1 id="disksprep-72"><title>Automatically Configuring SCSI Disk Drives</title><para>The <command>format</command> utility automatically configures SCSI
disk drives even if that specific type of drive is not listed in the <command>/etc/format.dat</command> file. This feature enables you to format, create slices for, and
label any disk driver that is compliant with the SCSI-2 specification for
disk device mode sense pages.</para><para>Here are other options for adding disks:</para><itemizedlist><listitem><para>If you are adding a SCSI disk, you might to try the <command>format</command> utility's automatic configuration feature. </para>
</listitem><listitem><para>You might try hot-plugging a PCI, SCSI, or USB disk. For more
information, see <olink targetptr="devconfig-27900" remap="internal">Chapter&nbsp;5, Managing
Devices (Overview/Tasks)</olink>.</para>
</listitem>
</itemizedlist><para>The following steps are involved in configuring a SCSI drive by using
automatic configuration:</para><itemizedlist><listitem><para>Shutting down the system</para>
</listitem><listitem><para>Attaching the SCSI disk drive to the system</para>
</listitem><listitem><para>Turning on the disk drive</para>
</listitem><listitem><para>Performing a reconfiguration boot</para>
</listitem><listitem><para>Using the <command>format</command> utility to automatically
configure the SCSI disk drive</para>
</listitem>
</itemizedlist><para>After the reconfiguration boot, invoke the <command>format</command> utility.
The <command>format</command> utility will attempt to configure the disk and,
if successful, alert the user that the disk was configured. For step-by-step
instructions on automatically configuring a SCSI disk drive, see <olink targetptr="disksprep-24067" remap="internal">How to Automatically Configure a SCSI Drive</olink>.</para><para>Here's an example of a partition table for a 1.3-Gbyte SCSI disk drive
that was displayed by the <command>format</command> utility.</para><screen>Part    Tag    Flag     Cylinders     Size        Blocks
   0     root    wm       0 -   96    64.41MB      (97/0/0)
   1     swap    wu      97 -  289   128.16MB     (193/0/0)
   2   backup    wu       0 - 1964     1.27GB    (1965/0/0)
   6      usr    wm     290 - 1964     1.09GB    (1675/0/0)</screen><task id="disksprep-24067"><title>How to Automatically Configure a SCSI Drive</title><procedure><step id="disksprep-step-75"><para>Become superuser or equivalent role.</para>
</step><step id="disksprep-step-77"><para>Shut down the system.</para><screen># <userinput>shutdown -i0 -g</userinput><replaceable>n</replaceable> <userinput>-y</userinput></screen><variablelist><varlistentry><term><option>i0</option></term><listitem><para>Brings the system down to init level 0, the power-down state.</para>
</listitem>
</varlistentry><varlistentry><term><option>g</option><replaceable>n</replaceable></term><listitem><para>Notifies logged-in users that they have <replaceable>n</replaceable> seconds
before the system begins to shut down.</para>
</listitem>
</varlistentry><varlistentry><term><option>y</option></term><listitem><para>Specifies that the command should run without user intervention.</para>
</listitem>
</varlistentry>
</variablelist><para>The <literal>ok</literal> prompt is displayed after the system is shut
down.</para>
</step><step id="disksprep-step-78"><para>Turn off the power to the system and all
external peripheral devices.</para>
</step><step id="disksprep-step-79"><para>Ensure that the disk you are adding has
a different target number than the other devices on the system.</para><para>Typically,
a small switch is located at the back of the disk for this purpose.</para>
</step><step id="disksprep-step-80"><para>Connect the disk to the system, and check
the physical connections.</para><para>Refer to the disk's hardware installation
guide for details.</para>
</step><step id="disksprep-step-81"><para>Turn on the power to all external peripherals.</para>
</step><step id="disksprep-step-82"><para>Turn on the power to the system.</para><para>The
system boots and displays the login prompt.</para>
</step><step id="disksprep-step-113"><para>Log back in as superuser or assume an
equivalent role.</para>
</step><step id="disksprep-step-83"><para>Invoke the <command>format</command> utility,
and select the disk that you want to configure automatically.</para><screen># <userinput>format</userinput>
Searching for disks...done
c1t0d0: configured with capacity of 1002.09MB
AVAILABLE DISK SELECTIONS:
0. c0t1d0 &lt;SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
   /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
1. c0t3d0 &lt;SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
   /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
Specify disk (enter its number): <userinput>1</userinput></screen>
</step><step id="disksprep-step-84"><para>Type <command>yes</command> in response
to the prompt to label the disk.</para><para>Typing <command>y</command> causes
the disk label to be generated and written to the disk by using SCSI automatic
configuration.</para><screen>Disk not labeled. Label it now? <userinput>y</userinput></screen>
</step><step id="disksprep-step-85"><para>Verify the disk label.</para><screen>format> <userinput>verify</userinput></screen>
</step><step id="disksprep-step-86"><para>Exit the <command>format</command> utility.</para><screen>format> <userinput>q</userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="disksprep-87"><title>Repairing a Defective Sector</title><para>If a disk on your system has a defective sector, you can repair the
disk by following procedures in this section. You might become aware of defective
sectors when you do the following:</para><itemizedlist><listitem><para>Run surface analysis on a disk</para><para>For more information
on the analysis feature of the <command>format</command> utility, see <olink targetptr="disksformat-11880" remap="internal">analyze Menu</olink>.</para><para>The defective
area reported while your system is running might not be accurate. Because
the system does disk operations many sectors at a time, it is often hard to
pinpoint exactly which sector caused a given error. To find the exact sector
or sectors, use <olink targetptr="disksprep-27270" remap="internal">How to Identify a Defective
Sector by Using Surface Analysis</olink>.</para>
</listitem><listitem><para>Get multiple error messages from the disk driver concerning
a particular portion of the disk while your system is running.</para><para>Console
messages that are related to disk errors appear similar to the following:</para><screen>WARNING: /io-unit@f,e0200000/sbi@0,0/QLGC,isp@1,10000/sd@3,0 (sd33):
	Error for command 'read' Error Level: Retryable
	Requested Block 126, Error Block: 179
	Sense Key: Media Error
	Vendor '<replaceable>name</replaceable>':
	ASC = 0x11 (unrecovered read error), ASCQ = 0x0, FRU = 0x0</screen><para>This message indicates that block 179 might be defective. You would
relocate the bad block by using the <command>format</command> utility's <command>repair</command> command. Or, you would use the <command>analyze</command> command
with the repair option enabled.</para>
</listitem>
</itemizedlist><task id="disksprep-27270"><title>How to Identify a Defective Sector by Using
Surface Analysis</title><procedure><step id="disksprep-step-89"><para>Become superuser or assume an equivalent
role.</para>
</step><step id="disksprep-step-90"><para>Unmount the file system in the slice that
contains the defective sector.</para><screen># <userinput>umount /dev/dsk/</userinput><replaceable>device-name</replaceable></screen><para>For more information, see <olink targetdoc="refman1m" targetptr="mount-1m" remap="external"><citerefentry><refentrytitle>mount</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>.</para>
</step><step id="disksprep-step-91"><para>Invoke the <command>format</command> utility.</para><screen># <userinput>format</userinput></screen>
</step><step id="disksprep-step-92"><para>Select the affected disk.</para><screen>Specify disk (enter its number):1
selecting c0t2d0:
[disk formatted]
Warning: Current Disk has mounted partitions.</screen>
</step><step id="disksprep-step-93"><para>Select the <literal>analyze</literal> menu.</para><screen>format> <userinput>analyze</userinput></screen>
</step><step id="disksprep-step-94"><para>Set up the analysis parameters by typing <command>setup</command> at the <literal>analyze></literal> prompt. </para><para>Use
the parameters shown here:</para><screen>analyze> <userinput>setup</userinput>
Analyze entire disk [yes]? <userinput>n</userinput>
Enter starting block number [0, 0/0/0]: <userinput>12330</userinput>
Enter ending block number [2052287, 2035/13/71]: <userinput>12360</userinput>
Loop continuously [no]? <userinput>y</userinput>
Repair defective blocks [yes]? <userinput>n</userinput>
Stop after first error [no]? <userinput>n</userinput>
Use random bit patterns [no]? <userinput>n</userinput>
Enter number of blocks per transfer [126, 0/1/54]: <userinput>1</userinput>
Verify media after formatting [yes]? <userinput>y</userinput>
Enable extended messages [no]? <userinput>n</userinput>
Restore defect list [yes]? <userinput>y</userinput>
Create defect label [yes]? <userinput>y</userinput></screen>
</step><step id="disksprep-step-95"><para>Find the defect by using the <command>read</command> command.</para><screen>analyze> <userinput>read</userinput>
Ready to analyze (won't harm SunOS). This takes a long time,
but is interruptible with Control-C. Continue? <userinput>y</userinput>
        pass 0
   2035/12/1825/7/24
        pass 1
Block 12354  (18/4/18), Corrected media error (hard data ecc)
   25/7/24
^C
Total of 1 defective blocks repaired.</screen>
</step>
</procedure>
</task><task id="disksprep-31929"><title>How to Repair a Defective Sector</title><procedure><step id="disksprep-step-97"><para>Become superuser or assume an equivalent
role.</para>
</step><step id="disksprep-step-98"><para>Invoke the <command>format</command> utility.</para><screen># <userinput>format</userinput></screen>
</step><step id="disksprep-step-114"><para>Select the disk that contains the defective
sector.</para><screen>Specify disk (enter its number): <userinput>1</userinput>
selecting c0t3d0
[disk formatted]
format> </screen>
</step><step id="disksprep-step-99"><para>Select the <command>repair</command> command.</para><screen>format> <userinput>repair</userinput></screen>
</step><step id="disksprep-step-100"><para>Type the defective block number.</para><screen>Enter absolute block number of defect: <userinput>12354</userinput>
   Ready to repair defect, continue? <userinput>y</userinput>
   Repairing block 12354 (18/4/18)...ok.
format></screen><para>If you are unsure of the format that
is used to identify the defective sector, see <olink targetptr="disksprep-27270" remap="internal">How to Identify a Defective Sector by Using Surface Analysis</olink> for more
information. </para>
</step>
</procedure>
</task>
</sect1><sect1 id="disksprep-101"><title>Tips and Tricks for Managing Disks</title><para>Use the following tips to help you manage disks more efficiently.</para><sect2 id="disksprep-102"><title>Debugging <command>format</command> Sessions</title><para>Invoke the <command>format</command> <option>M</option> command to enable
extended and diagnostic messages for ATA and SCSI devices.</para><example id="fahtc"><title>Debugging <command>format</command> Sessions</title><para>In this example, the series of numbers under <literal>Inquiry</literal> represent
the hexadecimal value of the <command>inquiry</command> data that is displayed
to the right of the numbers.</para><screen># <userinput>format -M</userinput>
Searching for disks...done
AVAILABLE DISK SELECTIONS:
  0. c0t1d0 &lt;SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
     /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
  1. c0t3d0 &lt;SUN1.05 cyl 2036 alt 2 hd 14 sec 72>
     /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
 
Specify disk (enter its number): <userinput>0</userinput>
selecting c0t3d0
[disk formatted]
format> <userinput>inquiry</userinput>
Inquiry:
00 00 02 02 8f 00 00 12 53 45 41 47 41 54 45 20     ........NAME....
53 54 31 31 32 30 30 4e 20 53 55 4e 31 2e 30 35     ST11200N SUN1.05
38 33 35 38 30 30 30 33 30 32 30 39 00 00 00 00     835800030209....
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
00 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 31     .Copyright (c) 1
39 39 32 20 53 65 61 67 61 74 65 20 41 6c 6c 20     992 NAME    All 
72 69 67 68 74 73 20 72 65 73 65 72 76 65 64 20     rights reserved 
30 30 30                                            000
Vendor:   <replaceable>name</replaceable> 
Product:  ST11200N SUN1.05
Revision: 8358
format> </screen>
</example>
</sect2><sect2 id="disksprep-103"><title>Labeling Multiple Disks by Using the <command>prtvtoc</command> and <command>fmthard</command> Commands</title><para>Use the <command>prtvtoc</command> and <command>fmthard</command> commands
to label multiple disks with the same disk geometry.</para><para>Use the following <command>for loop</command> in a script to copy a
disk label from one disk and replicate it on multiple disks.</para><screen># <userinput>for i in</userinput> <replaceable>x y z</replaceable>
> <userinput>do</userinput>
> <userinput>prtvtoc /dev/rdsk/</userinput>c<replaceable>w</replaceable>t<replaceable>x</replaceable>d<replaceable>y</replaceable>s<replaceable>z</replaceable> <userinput>| fmthard -s - /dev/rdsk/</userinput>c<replaceable>w</replaceable>t${i}d0s2
> <userinput>done</userinput></screen><example id="disksprep-104"><title>Labeling Multiple Disks</title><para>In this example, the disk label from <literal>c2t0d0s0</literal> is
copied to four other disks.</para><screen># <userinput>for i in 1 2 3 5</userinput>
> <userinput>do</userinput>
> <userinput>prtvtoc /dev/rdsk/c2t0d0s0 | fmthard -s - /dev/rdsk/c2t${i}d0s2</userinput>
> <userinput>done</userinput>
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.
#</screen>
</example>
</sect2>
</sect1>
</chapter>