<chapter id="disksformat-15833"><title>The <command>format</command> Utility
(Reference)</title><highlights><para>This chapter describes the <command>format</command> utility's menus
and commands.</para><para>This is a list of the reference information in this chapter. </para><itemizedlist><listitem><para><olink targetptr="disksformat-1" remap="internal">Recommendations and Requirements
for Using the format Utility</olink></para>
</listitem><listitem><para><olink targetptr="disksformat-34753" remap="internal">format Menu and Command
Descriptions</olink></para>
</listitem><listitem><para><olink targetptr="disksformat-20516" remap="internal">format.dat File</olink></para>
</listitem><listitem><para><olink targetptr="disksformat-12286" remap="internal">Rules for Input to format
Commands</olink></para>
</listitem><listitem><para><olink targetptr="disksformat-31805" remap="internal">Getting Help on the format
Utility</olink></para>
</listitem>
</itemizedlist><para>For a overview of when to use the <command>format</command> utility,
see <olink targetptr="disksconcepts-25867" remap="internal">format Utility</olink>.</para>
</highlights><sect1 id="disksformat-1"><title>Recommendations and Requirements for Using
the <command>format</command> Utility</title><para>You must be superuser or have assumed an equivalent role to use the <command>format</command> utility. Otherwise, the following error message is displayed
when you try to use the <command>format</command> utility:</para><screen>$ <userinput>format</userinput>
Searching for disks...done
No permission (or no disks found)!</screen><para>Keep the following guidelines in mind when you use the <command>format</command> utility
and want to preserve the existing data:</para><itemizedlist><listitem><para>Back up all files on the disk drive.</para>
</listitem><listitem><para>Save all your defect lists in files by using the <command>format</command> utility's <command>dump</command> command. The file name should include the drive type, model
number, and serial number.</para>
</listitem><listitem><para>Save the paper copies of the manufacturer's defect list that
was shipped with your drive.</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="disksformat-34753"><title><command>format</command> Menu and Command
Descriptions</title><para>The <literal>format</literal> main menu appears similar to the following:</para><screen>FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program (x86 only)
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !&lt;cmd>     - execute &lt;cmd>, then return
        quit
format> </screen><para>The following table
describes the main menu items for the <literal>format</literal> utility.</para><table frame="topbot" id="disksformat-22802"><title>The Main Menu Item Descriptions
for the <literal>format</literal> Utility</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="84*"/><colspec colname="column2" colwidth="66*"/><colspec colname="column3" colwidth="208*"/><thead><row rowsep="1"><entry><para>Menu Item</para>
</entry><entry><para>Command or Menu?</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><command>disk</command></para>
</entry><entry><para>Command</para>
</entry><entry><para>Lists all of the system's drives. Also lets you choose the disk you
want to use in subsequent operations. This disk is referred to as the current
disk.</para>
</entry>
</row><row><entry><para><command>type</command></para>
</entry><entry><para>Command</para>
</entry><entry><para>Identifies the manufacturer and model of the current disk. Also displays
a list of known drive types. Choose the <command>Auto configure</command> option
for all SCSI-2 disk drives.</para>
</entry>
</row><row><entry><para><command>partition</command></para>
</entry><entry><para>Menu</para>
</entry><entry><para>Creates and modifies slices. For more information, see <olink targetptr="disksformat-40633" remap="internal">partition Menu</olink>.</para>
</entry>
</row><row><entry><para><command>current</command></para>
</entry><entry><para>Command</para>
</entry><entry><para>Displays the following information about the current disk:</para><itemizedlist><listitem><para>Device name and device type</para>
</listitem><listitem><para>Number of cylinders, alternate cylinders, heads and sectors</para>
</listitem><listitem><para>Physical device name</para>
</listitem>
</itemizedlist>
</entry>
</row><row><entry><para><command>format</command></para>
</entry><entry><para>Command</para>
</entry><entry><para>Formats the current disk by using one of these sources of information
in this order:</para><orderedlist><listitem><para>Information that is found in the <filename>format.dat</filename> file</para>
</listitem><listitem><para>Information from the automatic configuration process</para>
</listitem><listitem><para>Information that you type at the prompt if no <filename>format.dat</filename> entry exists</para>
</listitem>
</orderedlist><para>This command does not apply to IDE disks. IDE disks are preformatted
by the manufacturer.</para>
</entry>
</row><row><entry><para><command>fdisk</command></para>
</entry><entry><para>Menu</para>
</entry><entry><para>x86 platform only: Runs the <command>fdisk</command> program to create
a Solaris <literal>fdisk</literal> partition.</para><para>The <command>fdisk</command> command cannot be used on disks with an
EFI label that are greater than 1 terabyte in size.</para>
</entry>
</row><row><entry><para><command>repair</command></para>
</entry><entry><para>Command</para>
</entry><entry><para>Repairs a specific block on the current disk.</para>
</entry>
</row><row><entry><para><command>label</command></para>
</entry><entry><para>Command</para>
</entry><entry><para>Writes a new label to the current disk.</para>
</entry>
</row><row><entry><para><command>analyze</command></para>
</entry><entry><para>Menu</para>
</entry><entry><para>Runs read, write, and compare tests. For more information, see <olink targetptr="disksformat-11880" remap="internal">analyze Menu</olink>.</para>
</entry>
</row><row><entry><para><command>defect</command></para>
</entry><entry><para>Menu</para>
</entry><entry><para>Retrieves and displays defect lists. For more information, see <olink targetptr="disksformat-17714" remap="internal">defect Menu</olink>. This feature does not apply
to IDE disks. IDE disks manage defects automatically.</para>
</entry>
</row><row><entry><para><command>backup</command></para>
</entry><entry><para>Command</para>
</entry><entry><para><emphasis role="strong">VTOC</emphasis> &ndash; Searches for backup
labels.</para><para><emphasis role="strong">EFI</emphasis> &ndash; Not supported.</para>
</entry>
</row><row><entry><para><command>verify</command></para>
</entry><entry><para>Command</para>
</entry><entry><para>Displays the following information about the current disk:</para><itemizedlist><listitem><para>Device name and device type</para>
</listitem><listitem><para>Number of cylinders, alternate cylinders, heads and sectors</para>
</listitem><listitem><para>Partition table</para>
</listitem>
</itemizedlist>
</entry>
</row><row><entry><para><command>save</command></para>
</entry><entry><para>Command</para>
</entry><entry><para><emphasis role="strong">VTOC</emphasis> &ndash; Saves new disk and partition
information.</para><para><emphasis role="strong">EFI</emphasis> &ndash; Not applicable.</para>
</entry>
</row><row><entry><para><command>inquiry</command></para>
</entry><entry><para>Command</para>
</entry><entry><para><emphasis role="strong">SCSI disks only</emphasis> &ndash; Displays
the vendor, product name, and revision level of the current drive.</para>
</entry>
</row><row><entry><para><command>volname</command></para>
</entry><entry><para>Command</para>
</entry><entry><para>Labels the disk with a new eight-character volume name that you specify.</para>
</entry>
</row><row><entry><para><command>quit</command></para>
</entry><entry><para>Command</para>
</entry><entry><para>Exits the <command>format</command> menu. </para>
</entry>
</row>
</tbody>
</tgroup>
</table><sect2 id="disksformat-40633"><title><literal>partition</literal> Menu</title><para>The <command>partition</command> menu appears similar to the following:</para><screen>format> <userinput>partition</userinput>
PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        quit
partition> </screen><para>The following table describes the <literal>partition</literal> menu
items.</para><table frame="topbot" id="disksformat-69196"><title>Descriptions for <literal>partition</literal> Menu Items</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="152*"/><colspec colname="column2" colwidth="304*"/><thead><row rowsep="1"><entry><para>Subcommand</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><command>change `</command><replaceable>n</replaceable><command>' partition</command></para>
</entry><entry><para>Enables you to specify the following information for the new partition:</para><itemizedlist><listitem><para>Identification tag</para>
</listitem><listitem><para>Permission flags</para>
</listitem><listitem><para>Starting cylinder</para>
</listitem><listitem><para>Size</para>
</listitem>
</itemizedlist>
</entry>
</row><row><entry><para><command>select</command></para>
</entry><entry><para>Enables you to choose a predefined partition table.</para>
</entry>
</row><row><entry><para><command>modify</command></para>
</entry><entry><para>Enables you to change all the slices in the partition table. This command
is preferred over the individual <command>change</command> `<replaceable>x</replaceable>' <command>partition</command> commands.</para>
</entry>
</row><row><entry><para><command>name</command></para>
</entry><entry><para>Enables you to specify a name for the current partition table.</para>
</entry>
</row><row><entry><para><command>print</command></para>
</entry><entry><para>Displays the current partition table.</para>
</entry>
</row><row><entry><para><command>label</command></para>
</entry><entry><para>Writes the partition map and the label to the current disk.</para>
</entry>
</row><row><entry><para><command>quit</command></para>
</entry><entry><para>Exits the <literal>partition</literal> menu.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="disksformat-2" arch="x86"><title><literal>fdisk</literal> Menu</title><para>The <literal>fdisk</literal> menu appears on x86 based systems only
and appears similar to the following.</para><screen>format> <userinput>fdisk</userinput>
             Total disk size is 14169 cylinders
             Cylinder size is 2510 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1       Active    x86 Boot          1     9       9      0
          2                 Solaris2         10  14168    14159    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. Exit (update disk configuration and exit)
  6. Cancel (exit without updating disk configuration)
  Enter Selection:</screen><para>The following table describes the <literal>fdisk</literal> menu items.</para><table frame="topbot" id="disksformat-27286" arch="x86"><title>Descriptions
for <literal>fdisk</literal> Menu Items</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="152*"/><colspec colname="column2" colwidth="304*"/><thead><row rowsep="1"><entry><para>Menu Item</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><command>Create a partition</command></para>
</entry><entry><para>Creates an <literal>fdisk</literal> partition. You must create a separate
partition for each OS such as Solaris or DOS. There is a maximum of four partitions
per disk. You are prompted for the size of the <literal>fdisk</literal> partition
as a percentage of the disk.</para>
</entry>
</row><row><entry><para><command>Specify the active partition</command></para>
</entry><entry><para>Enables you to specify the partition to be used for booting. This menu
item identifies where the first stage boot program looks for the second stage
boot program.</para>
</entry>
</row><row><entry><para><command>Delete a partition</command></para>
</entry><entry><para>Deletes a previously created partition. This command destroys all the
data in the partition.</para>
</entry>
</row><row><entry><para><command>Change between Solaris and Solaris2 Partition IDs</command></para>
</entry><entry><para>Changes partition IDs from 130 (<literal>0x82</literal>) to 191 (<literal>0xbf</literal>) and back again.</para>
</entry>
</row><row><entry><para><command>Exit (update disk configuration and exit)</command></para>
</entry><entry><para>Writes a new version of the partition table and exits the <literal>fdisk</literal> menu.</para>
</entry>
</row><row><entry><para><command>Cancel (exit without updating disk configuration)</command></para>
</entry><entry><para>Exits the <command>fdisk</command> menu without modifying the partition
table.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="disksformat-11880"><title><literal>analyze</literal> Menu</title><para>The <command>analyze</command> menu appears similar to the following.</para><screen>format> <userinput>analyze</userinput>
 
ANALYZE MENU:
    read     - read only test   (doesn't harm SunOS)
    refresh  - read then write  (doesn't harm data)
    test     - pattern testing  (doesn't harm data)
    write    - write then read      (corrupts data)
    compare  - write, read, compare (corrupts data)
    purge    - write, read, write   (corrupts data)
    verify   - write entire disk, then verify (corrupts data)
    print    - display data buffer
    setup    - set analysis parameters
    config   - show analysis parameters
    quit
analyze> </screen><para>The following table describes the <literal>analyze</literal> menu items.</para><table frame="topbot" id="disksformat-11816"><title>Descriptions for <literal>analyze</literal> Menu Items</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="101*"/><colspec colname="column2" colwidth="355*"/><thead><row rowsep="1"><entry><para>Subcommand</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><command>read</command></para>
</entry><entry><para>Reads each sector on the current disk. Repairs defective blocks as a
default.</para>
</entry>
</row><row><entry><para><command>refresh</command></para>
</entry><entry><para>Reads then writes data on the current disk without harming the data.
Repairs defective blocks as a default.</para>
</entry>
</row><row><entry><para><command>test</command></para>
</entry><entry><para>Writes a set of patterns to the disk without harming the data. Repairs
defective blocks as a default.</para>
</entry>
</row><row><entry><para><command>write</command></para>
</entry><entry><para>Writes a set of patterns to the disk then reads back the data on the
disk. Destroys existing data on the disk. Repairs defective blocks as a default.</para>
</entry>
</row><row><entry><para><command>compare</command></para>
</entry><entry><para>Writes a set of patterns to the disk, reads back the data, and then
compares it to the data in the write buffer. Destroys existing data on the
disk. Repairs defective blocks as a default.</para>
</entry>
</row><row><entry><para><command>purge</command> </para>
</entry><entry><para>Removes all data from the disk so that the data cannot be retrieved
by any means. Data is removed by writing three distinct patterns over the
entire disk (or a section of the disk).  If the verification passes, a hex-bit
pattern is written over the entire disk (or a section of the disk).</para><para>Repairs defective blocks as a default.</para>
</entry>
</row><row><entry><para><command>verify</command></para>
</entry><entry><para>In the first pass, writes unique data to each block on the entire disk.
 In the next pass, reads and verifies the data. Destroys existing data on
the disk. Repairs defective blocks as a default.</para>
</entry>
</row><row><entry><para><command>print</command></para>
</entry><entry><para>Displays the data in the read/write buffer.</para>
</entry>
</row><row><entry><para><command>setup</command></para>
</entry><entry><para>Enables you to specify the following analysis parameters:</para><programlisting>Analyze entire disk? yes
Starting block number: <replaceable>depends on drive</replaceable>
Ending block number: <replaceable>depends on drive</replaceable>
Loop continuously? no
Number of passes: 2
	Repair defective blocks? yes
Stop after first error? no
Use random bit patterns? no
Number of blocks per transfer: 126 (0/<replaceable>n</replaceable>/<replaceable>nn</replaceable>)
Verify media after formatting? yes
Enable extended messages? no
Restore defect list? yes
Restore disk label? yes</programlisting>
</entry>
</row><row><entry><para><command>config</command></para>
</entry><entry><para>Displays the current analysis parameters.</para>
</entry>
</row><row><entry><para><command>quit</command></para>
</entry><entry><para>Exits the <command>analyze</command> menu. </para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="disksformat-17714"><title><literal>defect</literal> Menu</title><para>The <literal>defect</literal> menu appears similar to the following:</para><screen>format> <userinput>defect</userinput>
 
DEFECT MENU:
        primary  - extract manufacturer's defect list
        grown    - extract manufacturer's and repaired defects lists
        both     - extract both primary and grown defects lists
        print    - display working list
        dump     - dump working list to file
        quit
defect> </screen><para>The following table describes the <literal>defect</literal> menu items.</para><table frame="topbot" id="disksformat-32434"><title>The <literal>defect</literal> Menu
Item Descriptions</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="101*"/><colspec colname="column2" colwidth="355*"/><thead><row rowsep="1"><entry><para>Subcommand</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><command>primary</command></para>
</entry><entry><para>Reads the manufacturer's defect list from the disk drive and updates
the in-memory defect list.</para>
</entry>
</row><row><entry><para><command>grown</command></para>
</entry><entry><para>Reads the grown defect list and then updates the in-memory defect list.
Grown defects are defects that have been detected during analysis.</para>
</entry>
</row><row><entry><para><command>both</command></para>
</entry><entry><para>Reads both the manufacturer's defect list and the grown defect list.
Then, updates the in-memory defect list.</para>
</entry>
</row><row><entry><para><command>print</command></para>
</entry><entry><para>Displays the in-memory defect list.</para>
</entry>
</row><row><entry><para><command>dump</command></para>
</entry><entry><para>Saves the in-memory defect list to a file.</para>
</entry>
</row><row><entry><para><command>quit</command></para>
</entry><entry><para>Exits the <command>defect</command> menu.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
</sect1><sect1 id="disksformat-20516"><title><filename>format.dat</filename> File</title><para>The <filename>format.dat</filename> file that is shipped with the Solaris OS supports
many standard disks. If your disk drive is not listed in the <filename>format.dat</filename> file, you can do the following:</para><itemizedlist><listitem><para>Add an entry to the <filename>format.dat</filename> file for
the disk.</para>
</listitem><listitem><para>Add entries with the <command>format</command> utility by
selecting the <command>type</command> command and choosing the <command>other</command> option.</para>
</listitem>
</itemizedlist><para>Adding an entry to the <filename>format.dat</filename> file can save
time if the disk drive will be used throughout your site. To use the <filename>format.dat</filename> file on other systems, copy the file to each system that will
use the specific disk drive that you added to the <filename>format.dat</filename> file.</para><para>You might need to modify the <filename>/etc/format.dat</filename> file
for your system if you have one of the following: </para><itemizedlist><listitem><para>A disk that is not supported by the Solaris OS</para>
</listitem><listitem><para>A disk with a partition table that is different from the Solaris OS's
default configuration</para>
</listitem>
</itemizedlist><note><para>Do not alter default entries in the <filename>/etc/format.dat</filename> file.
If you want to alter the default entries, copy the entry, give the entry a
different name, and make the appropriate changes to avoid confusion.</para>
</note><para>The <filename>/etc/format.dat</filename> is not applicable for disks
with EFI labels.</para><sect2 id="disksformat-3"><title>Contents of the <filename>format.dat</filename> File</title><para>The <filename>format.dat</filename> contains disk drive information
that is used by the <command>format</command> utility. Three items are defined
in the <filename>format.dat</filename> file:</para><itemizedlist><listitem><para>Search paths</para>
</listitem><listitem><para>Disk types</para>
</listitem><listitem><para>Slice tables</para>
</listitem>
</itemizedlist>
</sect2><sect2 id="disksformat-4"><title>Syntax of the <filename>format.dat</filename> File</title><para>The following syntax
rules apply to the <filename>/etc/format.dat</filename> file: </para><itemizedlist><listitem><para>The pound sign (<literal>#</literal>) is the comment character.
Any text on a line after a pound sign is not interpreted by the <command>format</command> utility. </para>
</listitem><listitem><para>Each definition in the <filename>format.dat</filename> file
appears on a single logical line. If the definition is longer than one line
long, all lines but the last line of the definition must end with a backslash
(<command>\</command>). </para>
</listitem><listitem><para>A definition consists of a series of assignments that have
an identifier on the left side and one or more values on the right side. The
assignment operator is the equal sign (<literal>=</literal>). The assignments
within a definition must be separated by a colon (<literal>:</literal>). </para>
</listitem><listitem><para>White space is ignored by the <command>format</command> utility.
If you want an assigned value to contain white space, enclose the entire value
in double quotation marks (<literal>"</literal>). This syntax causes the white
space within the quotes to be preserved as part of the assignment value.</para>
</listitem><listitem><para>Some assignments can have multiple values on the right side.
Separate values by a comma. </para>
</listitem>
</itemizedlist>
</sect2><sect2 id="disksformat-5"><title>Keywords in the <filename>format.dat</filename> File</title><para>The <filename>format.dat</filename> file
contains disk definitions that are read by the <command>format</command> utility
when it is started. Each definition starts with one of the following keywords: <literal>disk_type</literal> or <literal>partition</literal>. These keywords are described
in the following table.</para><table frame="topbot" id="disksformat-26632"><title>Keyword Descriptions for
the <filename>format.dat</filename> File</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="123.45*"/><colspec colname="column2" colwidth="332.55*"/><thead><row rowsep="1"><entry><para>Keyword</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>disk_type</literal></para>
</entry><entry><para>Defines the controller and disk model. Each <literal>disk_type</literal> definition
contains information that concerns the physical geometry of the disk. The
default data file contains definitions for the controllers and disks that
the Solaris OS supports.</para><para>You need to add a new <literal>disk_type</literal> definition only if
you have an unsupported disk. You can add as many <literal>disk_type</literal> definitions
to the data file as you want.</para>
</entry>
</row><row><entry><para><literal>partition</literal></para>
</entry><entry><para>Defines a partition table for a specific disk type. The partition table
contains the partition information, plus a name that lets you refer to it
in the <command>format</command> utility. The default <filename>format.dat</filename> file
contains default partition definitions for several kinds of disk drives. Add
a partition definition if you recreated partitions on any of the disks on
your system. Add as many partition definitions to the data file as you need. </para>
</entry>
</row>
</tbody>
</tgroup>
</table><sect3 id="disksformat-6"><title>Disk Type (<filename>format.dat</filename>)</title><para>The <literal>disk_type</literal> keyword in the <filename>format.dat</filename> file
defines the controller and disk model. Each <literal>disk_type</literal> definition
contains information about the physical geometry of the disk. The default <filename>format.dat</filename> file contains definitions for the controllers and disks
that the Solaris OS supports. You need to add a new <literal>disk_type</literal> only
if you have an unsupported disk. You can add as many <literal>disk_type</literal> definitions
to the data file as you want.</para><para>The keyword itself is assigned the name of the disk type. This name
appears in the disk's label, and is used to identify the disk type whenever
the <command>format</command> utility is run.  Enclose the name in double
quotation marks to preserve any white space in the name. The following table
describes the identifiers that must also be assigned values in all <literal>disk_type</literal> definitions.</para><table frame="topbot" id="disksformat-88559"><title>Required <literal>disk_type</literal> Identifiers
(<filename>format.dat</filename>)</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="95*"/><colspec colname="column2" colwidth="361*"/><thead><row rowsep="1"><entry><para>Identifier</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>ctlr</literal></para>
</entry><entry><para>Identifies the controller type for the disk type. Currently, the supported
values are SCSI and ATA. </para>
</entry>
</row><row><entry><para><literal>ncyl</literal></para>
</entry><entry><para>Specifies the number of data cylinders in the disk type. This determines
how many logical disk cylinders the system will be allowed to access. </para>
</entry>
</row><row><entry><para><literal>acyl</literal></para>
</entry><entry><para>Specifies the number of alternate cylinders in the disk type. These
cylinders are used by the <command>format</command> utility to store information
such as the defect list for the drive. You should always reserve at least
two cylinders for alternates.</para>
</entry>
</row><row><entry><para><literal>pcyl</literal></para>
</entry><entry><para>Specifies the number of physical cylinders in the disk type. This number
is used to calculate the boundaries of the disk media. This number is usually
equal to <literal>ncyl</literal> plus <literal>acyl</literal>.</para>
</entry>
</row><row><entry><para><literal>nhead</literal></para>
</entry><entry><para>Specifies the number of heads in the disk type. This number is used
to calculate the boundaries of the disk media. </para>
</entry>
</row><row><entry><para><literal>nsect</literal></para>
</entry><entry><para>Specifies the number of data sectors per track in the disk type. This
number is used to calculate the boundaries of the disk media. Note that this
number includes only the data sectors. Any spares are not reflected in the
number of data sections per track. </para>
</entry>
</row><row><entry><para><literal>rpm</literal></para>
</entry><entry><para>Specifies the rotations per minute of the disk type. This information
is put in the label and later used by the file system to calculate the optimal
placement of file data. </para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>Other identifiers might be necessary, depending on the controller. The
following table describes the identifiers that are required for SCSI controllers. </para><table frame="topbot" id="disksformat-14341"><title>Required <literal>disk_type</literal> Identifiers
for SCSI Controllers <filename>format.dat</filename></title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="70*"/><colspec colname="column2" colwidth="386*"/><thead><row rowsep="1"><entry><para>Identifier</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>fmt_time</literal></para>
</entry><entry><para>Specifies a number that indicates how long it takes to format a given
drive. See the controller manual for more information. </para>
</entry>
</row><row><entry><para><literal>cache</literal></para>
</entry><entry><para>Specifies a number that controls the operation of the on-board cache
while the <command>format</command> utility is operating. See the controller
manual for more information. </para>
</entry>
</row><row><entry><para><literal>trks_zone</literal></para>
</entry><entry><para>Specifies a number that identifies how many tracks that exist per defect
zone, to be used in alternate sector mapping. See the controller manual for
more information. </para>
</entry>
</row><row><entry><para><literal>asect</literal></para>
</entry><entry><para>Specifies a number that identifies how many sectors are available for
alternate mapping within a given defect zone. See the controller manual for
more information. </para>
</entry>
</row>
</tbody>
</tgroup>
</table><example id="fahth"><title>Required <literal>disk_type</literal> Identifiers
for SCSI Controllers (<filename>format.dat</filename>)</title><para>The following are examples of <literal>disk_type</literal> definitions:</para><screen>disk_type = "SUN1.3G" \
        : ctlr = SCSI : fmt_time = 4 \
        : trks_zone = 17 : asect = 6 : atrks = 17 \
        : ncyl = 1965 : acyl = 2 : pcyl = 3500 : nhead = 17 : nsect = 80 \
        : rpm = 5400 : bpt = 44823

disk_type = "SUN2.1G" \
        : ctlr = SCSI : fmt_time = 4 \
        : ncyl = 2733 : acyl = 2 : pcyl = 3500 : nhead = 19 : nsect = 80 \
        : rpm = 5400 : bpt = 44823

disk_type = "SUN2.9G" \
        : ctlr = SCSI : fmt_time = 4 \
        : ncyl = 2734 : acyl = 2 : pcyl = 3500 : nhead = 21 : nsect = 99 \
        : rpm = 5400</screen>
</example>
</sect3>
</sect2><sect2 id="disksformat-7"><title>Partition Tables (<filename>format.dat</filename>)</title><para>A partition table in the <filename>format.dat</filename> file defines
a slice table for a specific disk type.</para><para>The <literal>partition</literal> keyword in the <filename>format.dat</filename> file
is assigned the name of the partition table. Enclose the name in double quotation
marks to preserve any white space in the name. The following table describes
the identifiers that must be assigned values in all partition tables.</para><table frame="topbot" id="disksformat-11582"><title>Required Identifiers for
Partition Tables (<filename>format.dat</filename>)</title><tgroup cols="2" colsep="0" rowsep="1"><colspec colname="column1" colwidth="70*"/><colspec colname="column2" colwidth="386*"/><thead><row><entry><para>Identifier</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row rowsep="0"><entry><para><literal>disk</literal></para>
</entry><entry><para>The name of the <literal>disk_type</literal> that this partition table
is defined for. This name must appear exactly as it does in the <literal>disk_type</literal> definition.</para>
</entry>
</row><row><entry><para><literal>ctlr</literal></para>
</entry><entry><para>The disk controller type that this partition table can be attached to.
Currently, the supported values are ATA for ATA controllers and SCSI for SCSI
controllers. The controller type that is specified here must also be defined
for the <literal>disk_type</literal> that you specified in the <literal>disk_type</literal> definition. </para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The other identifiers
in a slice definition describe the actual partition information. The identifiers
are the numbers 0 through 7. These identifiers are optional. Any partition
that is not explicitly assigned is set to 0 length. The value of each of these
identifiers is a pair of numbers separated by a comma. The first number is
the starting cylinder for the partition. The second is the number of sectors
in the slice.</para><example id="fahtm"><title>Required Identifiers for Partition Tables (<filename>format.dat</filename>)</title><para>The following are some examples of slice definitions:</para><screen>partition = "SUN1.3G" \
        : disk = "SUN1.3G" : ctlr = SCSI \
        : 0 = 0, 34000 : 1 = 25, 133280 : 2 = 0, 2672400 : 6 = 123, 2505120

partition = "SUN2.1G" \
        : disk = "SUN2.1G" : ctlr = SCSI \
        : 0 = 0, 62320 : 1 = 41, 197600 : 2 = 0, 4154160 : 6 = 171, 3894240

partition = "SUN2.9G" \
        : disk = "SUN2.9G" : ctlr = SCSI \
        : 0 = 0, 195426 : 1 = 94, 390852 : 2 = 0, 5683986 : 6 = 282, 5097708</screen>
</example>
</sect2><sect2 id="disksformat-8"><title>Specifying an Alternate Data File for the <command>format</command> Utility</title><para>The <command>format</command> utility determines the location of an
alternate file by the following methods in this order:</para><orderedlist><listitem><para>If a file name is given with the <command>format</command> <option>x</option> option, that file is always used as the data file.</para>
</listitem><listitem><para>If the <option>x</option> option is not specified, then the <command>format</command> utility searches the current directory for a file named <filename>format.dat</filename>. If the file exists, it is used as the data file.</para>
</listitem><listitem><para>If neither of these methods yields a data file, the <command>format</command> utility uses the <filename>/etc/format.dat</filename> file as the
data file. This file is shipped with the Solaris OS and should always be
present.</para>
</listitem>
</orderedlist>
</sect2>
</sect1><sect1 id="disksformat-12286"><title>Rules for Input to <command>format</command> Commands</title><para>When you use the <command>format</command> utility, you need to provide various kinds of information. This
section describes the rules for this information. For information on using <command>format</command>'s help facility when you specify data, see <olink targetptr="disksformat-31805" remap="internal">Getting Help on the format Utility</olink>.</para><sect2 id="disksformat-9"><title>Specifying Numbers to <command>format</command> Commands</title><para>Several places in the <command>format</command> utility require number
as input. You must either specify the appropriate data or select a number
from a list of choices. In either case, the help facility causes <command>format</command> to
display the upper and lower limits of the number expected. Simply enter the
appropriate number. The number is assumed to be in decimal format unless a
base is explicitly specified as part of the number (for example, 0x for hexadecimal). </para><para>The following are examples of integer input: </para><screen>Enter number of passes [2]: <userinput>34</userinput> 
Enter number of passes [34] <userinput>Oxf</userinput></screen>
</sect2><sect2 id="disksformat-10"><title>Specifying Block Numbers to <command>format</command> Commands</title><para>Whenever
you are required to specify a disk block number, there are two ways to do
so:</para><itemizedlist><listitem><para>Specify the block number as an integer</para>
</listitem><listitem><para>Specify the block number in the cylinder/head/sector format</para>
</listitem>
</itemizedlist><para>You can specify the information as an integer that represents the logical
block number. You can specify the number in any base, but the default is decimal.
The maximum operator (a dollar sign, <literal>$</literal>) can also be used
here so that <command>format</command> utility can select the appropriate
value. Logical block format is used by the SunOS disk drivers in error messages.</para><para>The other way to specify a block number is by using cylinder/head/sector
format. In this method, you must specify explicitly the three logical components
of the block number: the cylinder, head, and sector values. These values are
still logical. However, they allow you to define regions of the disk that
are related to the layout of the media. </para><para>If any of the cylinder/head/sector numbers are not specified, the value
is assumed to be zero. You can also use the maximum operator in place of any
of the numbers. Then, the <command>format</command> utility will select the
appropriate value. The following are some examples of cylinder, head, and
sector values:</para><screen>Enter defective block number: <userinput>34/2/3</userinput>
Enter defective block number: <userinput>23/1/</userinput>
Enter defective block number: <userinput>457//</userinput>
Enter defective block number: <userinput>12345</userinput>
Enter defective block number: <userinput>Oxabcd</userinput>
Enter defective block number: <userinput>334/$/2</userinput>
Enter defective block number: <userinput>892//$</userinput></screen><para>The <command>format</command> utility always displays block numbers
in both formats. Also, the help facility shows you the upper and lower limits
of the block number expected, in both formats.</para>
</sect2><sect2 id="disksformat-11"><title>Specifying <command>format</command> Command
Names</title><para>Command
names are needed as input whenever the <command>format</command> utility displays
a menu prompt. You can abbreviate the command names, as long as what you type
is sufficient to uniquely identify the command desired. </para><para>For example, use <command>p</command> to access the <command>partition</command> menu
from the <command>format</command> menu. Then, type <command>p</command> to
display the current slice table.</para><screen>format> <userinput>p</userinput>
PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        quit
partition> <userinput>p</userinput></screen>
</sect2><sect2 id="disksformat-12"><title>Specifying Disk Names to <command>format</command> Commands</title><para>At certain points in
the <command>format</command> utility, you must name something. In these cases,
you are free to specify any string you want for the name. If the name has
white space in it, the entire name must be enclosed in double quotation marks
(<literal>"</literal>). Otherwise, only the first word of the name is used. </para><para>For example, if you want to identify a specific partition table for
a disk, you can use the <literal>name</literal> subcommand that is available
from the <command>partition</command> menu:</para><screen>partition> name
Enter table name (remember quotes): "new disk3"</screen>
</sect2>
</sect1><sect1 id="disksformat-31805"><title>Getting Help on the <command>format</command> Utility</title><para>The <command>format</command> utility provides a help facility that you can use whenever the <command>format</command> utility is expecting input. You can request help about what
input is expected by typing a question mark (<command>?</command>). The <command>format</command> utility displays a brief description of what type of input
is needed.</para><para>If you type a <command>?</command> at a menu prompt, a list of available
commands is displayed.</para><para>The man pages associated with the <command>format</command> utility
include the following:</para><itemizedlist><listitem><para><olink targetdoc="refman1m" targetptr="format-1m" remap="external"><citerefentry><refentrytitle>format</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> &ndash;
Describes the basic <command>format</command> utility capabilities and provides
descriptions of all command-line variables.</para>
</listitem><listitem><para><olink targetdoc="refman4" targetptr="format.dat-4" remap="external"><citerefentry><refentrytitle>format.dat</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> &ndash;
Describes disk drive configuration information for the <command>format</command> utility.</para>
</listitem>
</itemizedlist>
</sect1>
</chapter>