Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
Copyright 1989 AT&T
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
format [-f command-file] [-l log-file] [-x data-file] [-d disk-name] [-t disk-type] [-p partition-name] [-s] [-m] [-M] [-e] [disk-list]
format first uses the disk list defined in data-file if the -x option is used. format then checks for the FORMAT_PATH environment variable, a colon-separated list of filenames and/or directories. In the case of a directory, format searches for a file named format.dat in that directory; a filename should be an absolute pathname, and is used without change. format adds all disk and partition definitions in each specified file to the working set. Multiple identical definitions are silently ignored. If FORMAT_PATH is not set, the path defaults to /etc/format.dat.
disk-list is a list of disks in the form c?t?d? or /dev/rdsk/c?t?d?s?. With the latter form, shell wildcard specifications are supported. For example, specifying /dev/rdsk/c2* causes format to work on all drives connected to controller c2 only. If no disk-list is specified, format lists all the disks present in the system that can be administered by format.
Removable media devices are listed only when users execute format in expert mode (option -e). This feature is provided for backward compatibility. Use rmformat(1) for rewritable removable media devices.
Specify which disk should be made current upon entry into the program. The disk is specified by its logical name (for instance, -d c0t1d0). This can also be accomplished by specifying a single disk in the disk list.
Enable SCSI expert menu. Note this option is not recommended for casual use.
Take command input from command-file rather than the standard input. The file must contain commands that appear just as they would if they had been entered from the keyboard. With this option, format does not issue continue? prompts; there is no need to specify y(es) or n(o) answers in the command-file. In non-interactive mode, format does not initially expect the input of a disk selection number. The user must specify the current working disk with the -d disk-name option when format is invoked, or specify disk and the disk selection number in the command-file.
Log a transcript of the format session to the indicated log-file, including the standard input, the standard output and the standard error.
Enable extended messages. Provides more detailed information in the event of an error.
Enable extended and diagnostic messages. Provides extensive information on the state of a SCSI device's mode pages, during formatting.
Specify the partition table for the disk which is current upon entry into the program. The table is specified by its name as defined in the data file. This option can be used only if a disk is being made current, and its type is either specified or available from the disk label.
Silent. Suppress all of the standard output. Error messages are still displayed. This is generally used in conjunction with the -f option.
Specify the type of disk which is current upon entry into the program. A disk's type is specified by name in the data file. This option can only be used if a disk is being made current as described above.
Use the list of disks contained in data-file.
You can specify a disk by list number even if the disk is not displayed in the current screenful. For example, if the current screen shows disks 11-20, you can enter 25 to specify the twenty-fifth disk on the list. If you enter a number for a disk that is not currently displayed, format prompts you to verify your selection. If you enter a number from the displayed list, format silently accepts your selection.
After you specify a disk, format displays its main menu. This menu enables you to perform the following tasks: analyze
Run read, write, compare tests, and data purge. The data purge function implements the National Computer Security Center Guide to Understanding Data Remnance (NCSC-TG-025 version 2) Overwriting Algorithm. See NOTES.
Search for backup labels.
Enable, disable, and query the state of the write cache and read cache. This menu item only appears when format is invoked with the -e option, and is only supported on SCSI devices.
Display the device name, the disk geometry, and the pathname to the disk device.
Retrieve and print defect lists. This option is supported only on SCSI devices. IDE disks perform automatic defect management. Upon using the defect option on an IDE disk, you receive the message:
Controller does not support defect management or disk supports automatic defect management.
Choose the disk that will be used in subsequent operations (known as the current disk.)
Run the fdisk(8) program to create a fdisk partition for Solaris software (x86 based systems only).
Format and verify the current disk. This option is supported only on SCSI devices. IDE disks are pre-formatted by the manufacturer. Upon using the format option on an IDE disk, you receive the message:
Cannot format this drive. Please use your manufacturer-supplied formatting utility.
Display the vendor, product name, and revision level of the current drive.
Write a new label to the current disk.
Create and modify slices.
Exit the format menu.
Repair a specific block on the disk.
Save new disk and slice information.
Select (define) a disk type.
Read and display labels. Print information such as the number of cylinders, alternate cylinders, heads, sectors, and the partition table.
Label the disk with a new eight character volume name.
a colon-separated list of filenames and/or directories of disk and partition definitions. If a directory is specified, format searches for the file format.dat in that directory.
default data file
Mode sense page(4) reports rpm value as 0, adjusting it to 3600
This is a drive bug that may also occur with older third party drives. The above message is not an error; the drive will still function correctly.
Cylinder 0 contains the partition table (disk label), which can be overwritten if used in a raw disk partition by third party software.
format supports writing EFI-compliant disk labels in order to support disks or LUNs with capacities greater than one terabyte. However, care should be exercised since many software components, such as filesystems and volume managers, are still restricted to capacities of one terabyte or less. See the System Administration Guide: Basic Administration for additional information.
By default, on an unlabeled disk, EFI labels will be written on disks larger than 2 TB. When format is invoked with the -e option, on writing the label, the label type can be chosen. Booting is not currently supported on a disk with an EFI label.
For SCSI disks, formatting is done with both Primary and Grown defects list by default. However, if only Primary list is extracted in defect menu before formatting, formatting will be done with Primary list only.
Changing the state of the caches is only supported on SCSI devices, and not all SCSI devices support changing or saving the state of the caches.
The NCSC-TG-025 algorithm for overwriting meets the DoD 5200.28-M (ADP Security Manual) Eraser Procedures specification. The NIST Guidelines for Media Sanitization (NIST SP 800-88) also reference this algorithm.