FORMAT(8)

NAME
format - format disks or perform other defect management functions

SYNOPSIS
/etc/format -f|a bad_blocks [ -wv ] scsi_diskname
/etc/format -f|r|m|y|l|a|F|M|S|Y|A bad_blocks[ -wvnc ] -b file -s n -e n -h n -p n -d n -t type zdc_diskname
/etc/format -i|u diskname

DESCRIPTION
The format program is used to format disks and also to perform various other defect management functions. Because formatting and some of the other functions of the format program are potentially dangerous in that they destroy the data on the disk, this program should be used with care. To be safe, format has some built-in protections. First, format opens the device exclusively. If filesystems are mounted or for any other reason the device is already open, format will fail. It is possible that if the disk has fatal errors, the entire disk channel will be disabled, so caution should be exercised. For zdc disk types the sweepd(8) daemon process may be accessing the disk when an attempt to format is made. The format should be tried again. (It may be advisable to disable the daemon).

The functions and options available vary according to the disk subsystem being operated on. Currently, format supports the zdc disk subsystem and the embedded SCSI disks on the sd and wd subsystems. format determines the subsystem based on the diskname. Therefore, the diskname must use the standard Sequent prefixes (e.g., rzd0c, rsd0c, rwd0c). One of the arguments listed in the first section of the usage line above is required and indicates the function to be performed. The function, along with the subsystem, then determines which of the remaining arguments are necessary (or legal).

If the function will overwrite the disk, the user is prompted for confirmation.

All supported functions and options are listed below. Note that each subsystem does not necessarily support each function. Since some functions and options have different requirements or expect arguments in different formats depending on the subsystem, they are described in greater detail under the subsystem description sections. Following is a simple description of each argument.

FUNCTIONS

-f  Format the disk.

-r  Reformat the disk using the current bad-block list from the disk.

-m  Reformat the disk using the manufacturer's defect list from the disk.

-M  Recreate the bad block list from the manufactures defect list but do not format the disk. (Reserved for sequent use).

-S cylinder head
    Display the specified tracks headers.

-a bad_blocks
    Add a bad block to the bad-block list. Data on the bad block is recovered when possible.

-A bad_blocks
    Replace the entire bad-block list (Reserved for sequent use).

-F  Format a pre-wilson formatted disk (Reserved for sequent use).

-Y  Do not prompt user for confirmation.

-y  Run verify passes on the disk. During verify, data patterns are written on the disk and read back. If an error occurs, the block with the error is added to the bad-block list.

-l  List bad blocks. This displays the disk's bad-block list. (This list can be used as input for the manufacture's defect list).

-i  Print the type of the disk if it can be found.

-u  Usage will give a usage line based on the diskname provided.

OPTIONS

-v  Enable verbose output.

-w  Disable writing the diagnostic data at the end of the disk at the completion of the formatter function. By default, diagnostics are written after any operation that may destroy them, such as format or verify.

-n  Disable doing the verify passes at the completion of the formatter function. By default, those subsystems which support the verify function will do a default number of passes after a format or reformat operation.

-b filename
    Specify the file containing the defect list.

-s n
    Specify the starting address for the verify passes. By default, verify passes start at the beginning of the disk. Note that when -n is set, this is ignored.

-e n
    Specify the ending address for the verify passes. By default, verify passes write the full disk. Note that when -n is set, this is ignored.

-h  Specify the number of sector header verify passes to perform. A sector header verify pass does not cause data patterns to be written on the disk, but does test the header area of all sectors on a track which have either known header defects or more than 3 defects. This determination is based upon the current bad block list. Sector header verify passes always test suspected tracks on the entire disk; the specified starting and ending addresses have no effect. The default number of sector header passes is 10, at least 1 is manditory following format and reformat, and as part of verify. Note that when -n is set, this is not ignored.

-p  Specify the number of full verify passes to perform. A full verify pass causes the data patterns to be written from the specified starting address to the specified ending address. The default number of full passes is 3. Note that when -n is set, this is ignored.

-d  Specify the number of defect verify passes to perform. A defect verify pass causes the data patterns to be written only on those cylinders with known defects. The default number of defect passes is 45. Note that when -n is set, this is ignored.

-c  Check the data on the verify passes. Normally, during verify the data read back isn't actually compared to what was written. With this option, it is. Note that when -n is set, this is ignored.

-o  Override a sanity check. This option should only be used when a previous error condition indicates that -o could be used.

-t disktype
    Specify the type of the disk being operated on. This should correspond to one of the types specified in /etc/diskinfo.

  ZDC Support
This section describes items specific to the zdc subsystem. This includes descriptions of the arguments which differ in format or meaning from the generic description.

format expects to find channel configuration for each supported ZDC disk type in /etc/diskinfo/*.zd, where the base filename corresponds to a Sequent alias for the disk type. This is the name that would be entered for the -t type option. For example, the file m2344k.zd contains the channel configuration for the Fujitsu M2344K disk drive. To specify this disk type, you would use -t m2344k.

The zdc subsystem of format will defer termination of its current operation in an effort to prevent critical format information on the drive from accidentally being left in an inconsistent, unusable state. More specifically, it will catch SIGINT and SIGHUP signals during format and reformat operations, then terminate once the critical information has been written to the drive. Note that the deferred response time may be instantaneous or take over 20 minutes, depending on how near to completion the operation is and the type of drive being formatted. Likewise, during verify operations format will complete its current verification pass prior to terminating. However, this does not preclude desired, more immediate termination by the user; it is still possible to suspend format and explicitly send it another signal using the KILL(1) command, SIGKILL for example.

format requires that the drive being formatted is the ONLY drive in use on that channel. In order to repair "sector zero" drive defects, the controller chip configuration of the channel must be changed temporarily changed during the repair. Since each DCC channel uses a single controller chip configuration for all drives on that channel, the only safe way to perform this operation is to require that this be the only drive in use on the channel during this repair.

This does not necessarily mean that the system must be in single user mode to format the drive, but it does mean that they can use no other drive on that channel during the format. Disks sharing a channel with the root drive cannot be formatted using format.

The zdc subsystem of the formatter supports the format function, as well as two types of reformat (-r and -m). Be cautious in using the -m function, as any defects added to the bad-block list after the original manufacturer's list was put there will be lost. With any of the formatting functions (-f|r|m), verify passes will be done by default. This can be disabled with the -n option. When formatting (-f) a zdc disk, the following arguments are required. For example:

    format -f -b defect_list -t m2382k rzd1

The following arguments require description.

-a bad_blocks
    The addbad function requires an argument, which can be in one of two forms. The argument can be a filename, or it can be the actual defect data; if data, it should be enclosed in parentheses. format takes the first word following the -a and attempts to open a file corresponding to that word. If the open fails, it assumes the actual defect is specified. Defects for the addbad function on the zdc disks contain the following four fields separated by white space:

    cylinder head sector type

    where type is 0 for a bad header or 1 for bad data. Multiple defects may be specified in a file, with one defect per line.

-b defect_file
    The defect file contains the manufacturer's list of defects. It should contain one defect per line, with each defect consisting of four fields separated by white space. The four fields are:
    cylinder
    head
    number of bytes from index
    length of defect in bits

-t disktype
    The disk type must be one of the supported ZDC disk types. There must be a file in /etc/diskinfo that corresponds to the specified type.

-s n
    The argument indicates the starting cylinder for verify passes.

-e n
    The argument indicates the last cylinder for verify passes.

  SCSI Support
The SCSI subsystem of the format program supports CCS (Common Command Set) SCSI disks. This section describes items specific to the scsi subsystem. format expects a file /etc/diskinfo/*.scsi corresponding to each supported SCSI disk type. These files contain information used by the format program. There are no specific differences or requirements for SCSI disks other than those described generically above.

The following arguments require description.

-a bad_blocks
    The addbad function requires an argument, which can be in one of two forms. The argument can be a filename or the actual defect data. format takes the first word following the -a and attempts to open a file corresponding to that word. If the open fails, it assumes the actual defect is specified. Defects for the addbad function on the SCSI disks consist of the logical block address of the defect. More than one may be entered on the command line, separated by spaces. In a file, they must be separated by newlines.

EXAMPLES
    format -i sd0 format -f -b /usr/defects/m2382k.s400067.b -t m2382k rzd1 format -r rzd1 format -l rzd1 format -a "10 1 25 0 10 1 26 1" zd_diskname format -a /usr/defects/m2382k.s4000067.a zd_diskname

FILES
/etc/diskinfo/*.zd
/etc/diskinfo/*.scsi

SEE ALSO
scsiformat(8s), zdformat(8s), wdformat(8s), diskinfo(5).