'\" te .\" Copyright 1989 AT&T .\" Portions Copyright (c) 2002, 2015, Oracle and/or its affiliates. All .\" rights reserved. .TH format 1M "24 Sep 2015" "SunOS 5.11" "System Administration Commands" .SH NAME format \- disk partitioning and maintenance utility .SH SYNOPSIS .LP .nf \fBformat\fR [\fB-f\fR \fIcommand-file\fR] [\fB-l\fR \fIlog-file\fR] [\fB-x\fR \fIdata-file\fR] [\fB-d\fR \fIdisk-name\fR] [\fB-t\fR \fIdisk-type\fR] [\fB-p\fR \fIpartition-name\fR] [\fB-s\fR] [\fB-m\fR] [\fB-M\fR] [\fB-e\fR] [\fIdisk-list\fR] .fi .LP .nf \fBformat\fR \fB-L\fR \fIlabel-type\fR \fB-d\fR \fIdisk-name\fR .fi .SH DESCRIPTION .sp .LP \fBformat\fR enables you to format, label, repair, and analyze disks on your system. Unlike previous disk maintenance programs, \fBformat\fR runs under SunOS. Because there are limitations to what can be done to the system disk while the system is running, \fBformat\fR is also supported within the memory-resident system environment. For most applications, however, running \fBformat\fR under SunOS is the more convenient approach. .sp .LP \fBformat\fR first uses the disk list defined in \fIdata-file\fR if the \fB-x\fR option is used. \fBformat\fR then checks for the \fBFORMAT_PATH\fR environment variable, a colon-separated list of filenames and/or directories. In the case of a directory, \fBformat\fR searches for a file named \fBformat.dat\fR in that directory; a filename should be an absolute pathname, and is used without change. \fBformat\fR adds all disk and partition definitions in each specified file to the working set. Multiple identical definitions are silently ignored. If \fBFORMAT_PATH\fR is not set, the path defaults to \fB/etc/format.dat\fR. .sp .LP \fIdisk-list\fR is a list of disks in the form \fBc?t?d?\fR, or \fB/dev/rdsk/c?t?d?s?\fR, \fB/dev/chassis/?/disk\fR. With the last two forms, shell wildcard specifications are supported. For example, specifying \fB/dev/rdsk/c2*\fR causes \fBformat\fR to work on all drives connected to controller \fBc2\fR only. If no \fIdisk-list\fR is specified, \fBformat\fR lists all the disks present in the system that can be administered by \fBformat\fR. .sp .LP Removable media devices are listed only when users execute \fBformat\fR in expert mode (option \fB-e\fR). This feature is provided for backward compatibility. Use \fBrmformat\fR(1) for rewritable removable media devices. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-d\fR \fIdisk-name\fR\fR .ad .RS 21n .rt Specify which disk should be made current upon entry into the program. The disk is specified by its logical name (for instance, \fB-d\fR \fBc0t1d0\fR or \fB/dev/chassis/SYS/HD0/disk\fR). This can also be accomplished by specifying a single disk in the disk list. .RE .sp .ne 2 .mk .na \fB\fB-e\fR\fR .ad .RS 21n .rt Enable \fBSCSI\fR expert menu. Note this option is not recommended for casual use. .RE .sp .ne 2 .mk .na \fB\fB-f\fR \fIcommand-file\fR\fR .ad .RS 21n .rt Take command input from \fIcommand-file\fR 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, \fBformat\fR does not issue \fBcontinue?\fR prompts; there is no need to specify y(es) or n(o) answers in the \fIcommand-file\fR. In non-interactive mode, \fBformat\fR does not initially expect the input of a disk selection number. The user must specify the current working disk with the \fB-d\fR \fIdisk-name\fR option when format is invoked, or specify \fBdisk\fR and the disk selection number in the \fIcommand-file\fR. .RE .sp .ne 2 .mk .na \fB\fB-l\fR \fIlog-file\fR\fR .ad .RS 21n .rt Log a transcript of the \fBformat\fR session to the indicated \fIlog-file\fR, including the standard input, the standard output and the standard error. .RE .sp .ne 2 .mk .na \fB\fB-L\fR \fIlabel-type\fR\fR .ad .RS 21n .rt Immediately, and non-interactively, write a default label of type \fIlabel-type\fR, to the disk specified with \fB-d\fR. \fIlabel-type\fR must be either \fBefi\fR or \fBvtoc\fR. Existing label, if any, will be overwritten with \fIlabel-type\fR. On an x86 machine, the whole disk will default to one Solaris partition labeled with \fIlabel-type\fR; all \fBfdisk\fR partitions will be lost. .RE .sp .ne 2 .mk .na \fB\fB-m\fR\fR .ad .RS 21n .rt Enable extended messages. Provides more detailed information in the event of an error. .RE .sp .ne 2 .mk .na \fB\fB-M\fR\fR .ad .RS 21n .rt Enable extended and diagnostic messages. Provides extensive information on the state of a \fBSCSI\fR device's mode pages, during formatting. .RE .sp .ne 2 .mk .na \fB\fB-p\fR \fIpartition-name\fR\fR .ad .RS 21n .rt 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. .RE .sp .ne 2 .mk .na \fB\fB-s\fR\fR .ad .RS 21n .rt Silent. Suppress all of the standard output. Error messages are still displayed. This is generally used in conjunction with the \fB-f\fR option. .RE .sp .ne 2 .mk .na \fB\fB-t\fR \fIdisk-type\fR\fR .ad .RS 21n .rt 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. .RE .sp .ne 2 .mk .na \fB\fB-x\fR \fIdata-file\fR\fR .ad .RS 21n .rt Use the list of disks contained in \fIdata-file\fR. .RE .SH USAGE .sp .LP When you invoke format with no options or with the \fB-e\fR, \fB-l\fR, \fB-m\fR, \fB-M\fR, or \fB-s\fR options, the program displays a numbered list of available disks and prompts you to specify a disk by list number. If the machine has more than a screenful of disks, press SPACE to see the next screenful of disks. .sp .LP 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 \fB25\fR to specify the twenty-fifth disk on the list. If you enter a number for a disk that is not currently displayed, \fBformat\fR prompts you to verify your selection. If you enter a number from the displayed list, \fBformat\fR silently accepts your selection. .sp .LP After you specify a disk, \fBformat\fR displays its main menu. This menu enables you to perform the following tasks: .sp .ne 2 .mk .na \fBanalyze\fR .ad .RS 13n .rt Run read, write, compare tests, and data purge. The data purge function implements the National Computer Security Center Guide to Understanding Data Remnance (\fBNCSC-TG-025\fR version 2) Overwriting Algorithm. See NOTES. .RE .sp .ne 2 .mk .na \fBbackup\fR .ad .RS 13n .rt Search for backup labels. .RE .sp .ne 2 .mk .na \fBcache\fR .ad .RS 13n .rt Enable, disable, and query the state of the write cache and read cache. This menu item only appears when \fBformat\fR is invoked with the \fB-e\fR option, and is only supported on \fBSCSI\fR devices.. .RE .sp .ne 2 .mk .na \fBcurrent\fR .ad .RS 13n .rt Display the device name, the disk geometry, and the pathname to the disk device. .RE .sp .ne 2 .mk .na \fBdefect\fR .ad .RS 13n .rt Retrieve and print defect lists. This option is supported only on \fBSCSI\fR devices. \fBIDE\fR disks perform automatic defect management. Upon using the \fBdefect\fR option on an \fBIDE\fR disk, you receive the message: .sp .in +2 .nf Controller does not support defect management or disk supports automatic defect management. .fi .in -2 .sp .RE .sp .ne 2 .mk .na \fBdisk\fR .ad .RS 13n .rt Choose the disk that will be used in subsequent operations (known as the current disk.) .RE .sp .ne 2 .mk .na \fBfdisk\fR .ad .RS 13n .rt Run the \fBfdisk\fR(1M) program to create a \fBfdisk\fR partition for Solaris software (x86 based systems only). .RE .sp .ne 2 .mk .na \fBformat\fR .ad .RS 13n .rt Format and verify the current disk. This option is supported only on \fBSCSI\fR devices. \fBIDE\fR disks are pre-formatted by the manufacturer. Upon using the \fBformat\fR option on an \fBIDE\fR disk, you receive the message: .sp .in +2 .nf Cannot format this drive. Please use your manufacturer-supplied formatting utility. .fi .in -2 .sp .RE .sp .ne 2 .mk .na \fBinquiry\fR .ad .RS 13n .rt Display the vendor, product name, and revision level of the current drive. .RE .sp .ne 2 .mk .na \fBlabel\fR .ad .RS 13n .rt Write a new label to the current disk. .RE .sp .ne 2 .mk .na \fBpartition\fR .ad .RS 13n .rt Create and modify slices. .RE .sp .ne 2 .mk .na \fBquit\fR .ad .RS 13n .rt Exit the format menu. .RE .sp .ne 2 .mk .na \fBrepair\fR .ad .RS 13n .rt Repair a specific block on the disk. .RE .sp .ne 2 .mk .na \fBsave\fR .ad .RS 13n .rt Save new disk and slice information. .RE .sp .ne 2 .mk .na \fBtype\fR .ad .RS 13n .rt Select (define) a disk type. .RE .sp .ne 2 .mk .na \fBverify\fR .ad .RS 13n .rt Read and display labels. Print information such as the number of cylinders, alternate cylinders, heads, sectors, and the partition table. .RE .sp .ne 2 .mk .na \fBvolname\fR .ad .RS 13n .rt Label the disk with a new eight character volume name. .RE .SH ENVIRONMENT VARIABLES .sp .ne 2 .mk .na \fB\fBFORMAT_PATH\fR\fR .ad .RS 15n .rt a colon-separated list of filenames and/or directories of disk and partition definitions. If a directory is specified, \fBformat\fR searches for the file \fBformat.dat\fR in that directory. .RE .SH FILES .sp .ne 2 .mk .na \fB\fB/etc/format.dat\fR\fR .ad .RS 19n .rt default data file .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/core-os .TE .SH SEE ALSO .sp .LP \fBfmthard\fR(1M), \fBprtvtoc\fR(1M), \fBrmformat\fR(1), \fBformat.dat\fR(4), \fBattributes\fR(5), \fBsd\fR(7D) .sp .LP \fIManaging Devices in Oracle Solaris 11.2\fR .SS "x86 Only" .sp .LP \fBfdisk\fR(1M) .SH WARNINGS .sp .LP Cylinder 0 contains the partition table (disk label), which can be overwritten if used in a raw disk partition by third party software. On x86-based systems, this usage could cause the cylinder information to be off by one, and some difference in the capacity as a consequence, depending on whether the disk is labled and whether the whole disk is designated as a single Solaris partition. .sp .LP Please also note that the CHS (Cylinder/Head/Sector) geometry might be logical only to maintain backward compatibility, which has no physical bearing to actual disk device. .sp .LP \fBformat\fR supports writing \fBEFI\fR-compliant disk labels in order to support disks or \fBLUN\fRs 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 \fIManaging Devices in Oracle Solaris 11.2\fR for additional information. .sp .LP By default, on an unlabeled disk, EFI labels will be written on disks larger than 2 TB. When \fBformat\fR is invoked with the \fB-e\fR option, on writing the label, the label type can be chosen. GPT (EFI) enabled SPARC firmware and UEFI x86 firmware are required to boot these EFI-labeled drives. .SH NOTES .sp .LP \fBformat\fR provides a help facility you can use whenever format is expecting input. You can request help about what information is expected by simply entering a question mark (\fB?\fR) and \fBformat\fR prints a brief description of what type of input is needed. If you enter a \fB?\fR at the menu prompt, a list of available commands is displayed. .sp .LP For \fBSCSI\fR 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. .sp .LP Changing the state of the caches is only supported on \fBSCSI\fR devices, and not all \fBSCSI\fR devices support changing or saving the state of the caches. .sp .LP The \fBNCSC-TG-025\fR algorithm for overwriting meets the \fBDoD\fR 5200.28-M (\fBADP\fR Security Manual) Eraser Procedures specification. The \fBNIST\fR Guidelines for Media Sanitization (\fBNIST\fR \fBSP\fR 800-88) also reference this algorithm.