format enables you to format, label, repair and analyze disks on your system. Unlike previous disk maintenance programs, format runs under SunOS. Because there are limitations to what can be done to the system disk while the system is running, format is also supported within the memory-resident system environment. For most applications, however, running format under SunOS is the more convenient approach.
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.
The following options are supported:
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 only be used 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.
The format utility's main menu items allow you to do the following tasks:
Run read, write, and compare tests.
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.
Choose the disk that will be used in subsequent operations (known as the current disk.)
Run the fdisk(1M) program to create a fdisk partition for Solaris software (IA based systems only).
Format and verify the current disk.
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.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
See Disk Management in System Administration Guide, Volume 1
When the format function is selected to format the Maxtor 207MB disk, the following message displays:
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.
format 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 (?) and format prints a brief description of what type of input is needed. If you enter a ? at the menu prompt, a list of available commands is displayed.
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.