FORMAT(8R) —
NAME
format − format hard disks
DESCRIPTION
Format is a standalone program used to format and check disks prior to constructing file systems. In addition to the formatting operation, format records any bad sectors encountered (see disk(4)). Formatting is performed one track at a time by writing the appropriate headers and a test pattern, then checking the sector by reading and verifying the pattern using the controller’s Error Correcting Code (ECC) for error detection. A sector is marked bad if any media error is detected. After the entire disk has been formatted and checked, the total number of errors is reported, any bad sectors are marked, and bad-sector forwarding information is written to the disk. Format may be used on 40, 70, 114, and 310 MB disks supported by the hd driver.
The test pattern used during the media check may be selected from the following: 0xf00f (RH750 worst case), 0xec6d (media worst case), 0xa5a5 (alternating 1’s and 0’s) and 0x000. Normally the media worst-case pattern is used.
Format also has an option to perform an extended “severe burn-in”, which makes 1 to 32 passes using different patterns. Under this option, any sectors with errors are marked bad. This test runs for many hours, depending on the disk size and repeat count.
Each time format is run, any new errors found will be added to the existing bad-block table based on errors encountered during formatting. The device driver, however, will always attempt to read an existing bad-sector table when the device is first opened. Thus, if a disk drive has lost its formatting information, error messages will be printed when the driver attempts to read the bad-sector table; these diagnostics should be ignored.
It is possible to erase the existing bad-block table by using the “change defaults” menu. This is useful when the reason for reformatting is that another disk’s bad-block table was copied onto the disk to be formatted.
For every cylinder formatted, format prints a message indicating the cylinder currently being formatted. All the burn-in and multiple passes are made on each cylinder in turn, so the progress can be determined by the cylinder number printed.
Format uses the standard notation of the standalone I/O library in identifying a drive to be formatted. A drive is specified as zz(x,y), where zz refers to the controller type (hd), x is the unit number of the drive and y is the file system partition on drive x (this should be 2 for the entire IBM/4.3 partition of the disk). For example, hd(0,2) indicates that drive 0 on adapter 0 should be formatted. Drive numbers are assigned sequentially (0, 1, 2 ...). If the first adapters has 2 drives attached, they will be called hd(0,2) and hd(1,2). If there is only one drive on the first adapter, then hd(1,2) refers to the first drive on the second adapter.
Format should be used prior to building file systems (with newfs(8)) to ensure that all sectors with uncorrectable media errors are remapped. If a drive develops uncorrectable defects after formatting, format should be used to add additional blocks by reformatting the cylinders containing the bad blocks. In this case, be sure to request that the original data be saved.
Format checks the keyboard after formatting each track so that it is possible to stop at a safe place by hitting the enter key, which will cause the program to ask the user whether formatting should be stopped. If the answer is yes, the normal exit processing will be done. Formatting can be resumed later by starting it again at the appropriate cylinder. A negative answer will continue formatting.
EXAMPLE
A sample run of format is shown below. Format was loaded from option 2, “format - format hard disk”, of sautil(8R) on the IBM RT PC; it could also have been loaded from option 11, “convert - R70 (“hd70r”) disk to an E70”. Boldface means user input. As usual, “#” and “@” may be used to edit input.
∗∗∗ Standalone Format $Revision: 12.0 $ ∗∗∗
Device to format? hd(2,2)
(error messages may occur as old bad-sector table is read)
Formatting drive hd2: verify (yes/no)? yes
Available test patterns are:
1 - (f00f) rh750 worst case
2 - (ec6d) media worst case
3 - (a5a5) alternating 1’s and 0’s
4 - (0) zero disk
5 - (ffff) Severe burn-in (takes several hours)
Select Pattern (one of the above, other to restart) [5]: 2
Device data: #cylinders=566, #tracks=7, #sectors=36
Existing bad block table is 86 entries long
Change defaults? [n] yes
1 Change interleave [4]
2 Change first cylinder [0]
3 Change last cylinder [565]
4 Change number of entries in Bad and Hidden tables[86]
5 Print current Bad and Hidden tables
6 Add new Bad Block Table entry
7 Exit Format (with no more changes to disk)
8 Change pattern
9 Delete block from Bad and Hidden tables
10 Convert block number to cyl, track, sector
11 Convert cyl, track, sector to block number
12 Number of passes [1]
13 Write Bad and Hidden tables every [0] cylinders
14 Interactive addition of bad blocks
15 Number of times to retry save read [8]
16 Change configuration record
Any other value exits change menu and starts FORMAT
Block numbers can be either ’nnn’ or ’ccc.ttt.sss’ (1234 or 1.0.1)
Option: 0
Attempt to preserve existing data (yes/no) ? [y] yes
Start FORMAT (yes/no) ? yes
FORMAT of hd(2,2) ... [cylinders 0 through 565]
FORMATTING CYLINDER 565
A total of 86 bad blocks were found
A total of 0 of these were found on this format
Contents of Bad Block Table:
(the contents are listed)
Writing Bad Block Table at block number 8
Format done ...
Exit called - Press Enter to return to main menu
DIAGNOSTICS
The diagnostics are intended to be self-explanatory.
USING THE DIAGNOSTICS DISKETTE TO FORMAT
You should shut down IBM/4.3 and halt the machine to do any disk formatting. Note that the diagnostics diskette format routine does not attempt to save data.
SEE ALSO
sautil(8R), disk(4), hd(4), newfs(8)
BUGS
It should be possible to specify that the bad-block table be read from some other file or device so that it can easily be restored from a backup copy in case of loss.
Format does not format SCSI disks.
PRPQs 5799-WZQ/5799-PFF: IBM/4.3 — Sept 1988