1.\" $NetBSD: format.8,v 1.14 2017/07/03 21:31:00 wiz Exp $ 2.\" 3.\" Copyright (c) 1980, 1983, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" from: @(#)format.8 8.1 (Berkeley) 6/5/93 31.\" 32.Dd February 17, 2017 33.Dt FORMAT 8 vax 34.Os 35.Sh NAME 36.Nm format 37.Nd how to format disk packs 38.Sh DESCRIPTION 39There are two ways to format disk packs. The simplest is to 40use the 41.Nm 42program. 43The alternative is to use the DEC standard formatting software which 44operates under the DEC diagnostic supervisor. 45This manual page describes the operation of 46.Nm , 47then concludes with some remarks about using the DEC formatter. 48.Pp 49.Nm 50is a standalone program used to format and check disks prior to 51constructing file systems. 52In addition to the formatting operation, 53.Nm 54records any bad sectors encountered according to DEC standard 144. 55Formatting is performed one track at a time by writing the appropriate 56headers and a test pattern and then checking the sector by reading and 57verifying the pattern, using the controller's ECC for error detection. 58A sector is marked bad if an unrecoverable media error is detected, or 59if a correctable ECC error too many bits in length is detected (such 60errors are indicated as 61.Dq ECC 62in the summary printed upon completing the format operation). 63After the entire disk has been formatted and checked, the total number 64of errors are reported, any bad sectors and skip sectors are marked, 65and a bad sector forwarding table is written to the disk in the first 66five even numbered sectors of the last track. 67It is also possible to reformat sections of the disk in units of 68tracks. 69.Nm 70may be used on any 71.Tn UNIBUS 72or 73.Tn MASSBUS 74drive supported by the 75.Em up 76and 77.Em hp 78device drivers which uses 4-byte headers (everything except RP's). 79.Pp 80The test pattern used during the media check may be selected from one 81of: 0xf00f (RH750 worst case), 0xec6d (media worst case), and 0xa5a5 82(alternating 1's and 0's). 83Normally the media worst case pattern is used. 84.Pp 85.Nm 86also has an option to perform an extended 87.Dq severe burn-in , 88which makes a number of passes using different patterns. 89The number of passes can be selected at run time, up to a maximum of 9048, with provision for additional passes or termination after the 91preselected number of passes. 92This test runs for many hours, depending on the disk and processor. 93.Pp 94Each time 95.Nm 96is run to format an entire disk, a completely new bad sector table is 97generated based on errors encountered while formatting. 98The device driver, however, will always attempt to read any existing 99bad sector table when the device is first opened. 100Thus, if a disk pack has never previously been formatted, or has been 101formatted with different sectoring, five error messages will be 102printed when the driver attempts to read the bad sector table; these 103diagnostics should be ignored. 104.Pp 105Formatting a 400 megabyte disk on a 106.Tn MASSBUS 107disk controller usually takes about 20 minutes. 108Formatting on a 109.Tn UNIBUS 110disk controller takes significantly longer. 111For every hundredth cylinder formatted 112.Nm 113prints a message indicating the current cylinder being formatted. 114(This message is just to reassure people that nothing is amiss.) 115.Pp 116.Nm 117uses the standard notation of the standalone I/O library in 118identifying a drive to be formatted. 119A drive is specified as 120.Em zz(x,y) , 121where 122.Em zz 123refers to the controller type (either 124.Em hp 125or 126.Em up ) , 127.Em x 128is the unit number of the drive; 8 times the 129.Tn UNIBUS 130or 131.Tn MASSBUS 132adaptor number plus the 133.Tn MASSBUS 134drive number or 135.Tn UNIBUS 136drive unit number; and 137.Em y 138is the file system partition on drive 139.Em x 140(this should always be 0). 141For example, 142.Dq hp(1,0) 143indicates that drive 1 on 144.Tn MASSBUS 145adaptor 0 should be formatted; while 146.Dq up(10,0) 147indicates that 148.Tn UNIBUS 149drive 2 on 150.Tn UNIBUS 151adaptor 1 should be formatted. 152.Pp 153Before each formatting attempt, 154.Nm 155prompts the user in case debugging should be enabled in the 156appropriate device driver. 157A carriage return disables debugging information. 158.Pp 159.Nm 160should be used prior to building file systems (with 161.Xr newfs 8 162to ensure that all sectors with uncorrectable media errors are 163remapped. 164If a drive develops uncorrectable defects after formatting, either 165.Xr bad144 8 166or 167.Xr badsect 8 168should be able to avoid the bad sectors. 169.Sh EXAMPLES 170A sample run of 171.Nm 172is shown below. 173In this example (using a 174.Tn VAX-11/780 ) , 175.Nm 176is loaded from the console floppy; 177on an 11/750 178.Nm 179will be loaded from the root file system with 180.Xr vax/boot 8 181following a 182.Dq B/3 183command. 184Boldface means user input. 185As usual, 186.Dq # 187and 188.Dq @ 189may be used to edit input. 190.Bd -literal -offset 0.5i 191>>>\fBL FORMAT\fP 192 LOAD DONE, 00004400 BYTES LOADED 193>>>\fBS 2\fP 194Disk format/check utility 195.sp 196Enable debugging (0=none, 1=bse, 2=ecc, 3=bse+ecc)? \fB0\fP 197Device to format? \fBhp(8,0)\fP 198(\fIerror messages may occur as old bad sector table is read\fP) 199Formatting drive hp0 on adaptor 1: verify (yes/no)? \fByes\fP 200Device data: #cylinders=842, #tracks=20, #sectors=48 201Starting cylinder (0): 202Starting track (0): 203Ending cylinder (841): 204Ending track (19): 205Available test patterns are: 206.Ed 207.Bd -literal -offset 1.5i -compact 2081 - (f00f) RH750 worst case 2092 - (ec6d) media worst case 2103 - (a5a5) alternating 1's and 0's 2114 - (ffff) Severe burnin (up to 48 passes) 212.Ed 213.Bd -literal -offset 0.5i -compact 214Pattern (one of the above, other to restart)? \fB2\fP 215Maximum number of bit errors to allow for soft ECC (3): 216Start formatting...make sure the drive is online 217 ... 218(\fIsoft ecc's and other errors are reported as they occur\fP) 219 ... 220(\fIif 4 write check errors were found, the program terminates like this...\fP) 221 ... 222Errors: 223Bad sector: 0 224Write check: 4 225Hard ECC: 0 226Other hard: 0 227Marked bad: 0 228Skipped: 0 229Total of 4 hard errors revectored. 230Writing bad sector table at block 808272 231(\fI808272 is the block # of the first block in the bad sector table\fP) 232Done 233(\fI...program restarts to allow formatting other disks\fP) 234(\fI...to abort halt machine with ^P\fP) 235.Ed 236.Sh DIAGNOSTICS 237The diagnostics are intended to be self explanatory. 238.Sh USING DEC SOFTWARE TO FORMAT 239.Em Warning: These instructions are for people with 11/780 CPUs. 240The steps needed for 11/750 or 11/730 CPU's are similar, but not 241covered in detail here. 242.Pp 243The formatting procedures are different for each type of disk. 244Listed here are the formatting procedures for RK07's, RP0X, and RM0X 245disks. 246.Pp 247You should shut down UNIX and halt the machine to do any disk formatting. 248Make certain you put in the pack you want formatted. 249It is also a good idea to spin down or write protect the disks you 250don't want to format, just in case. 251.Ss Formatting an RK07 252Load the console floppy labeled, 253.Dq RX11 VAX DSK LD DEV #1 254in the console disk drive, and type the following commands: 255.Bd -literal -offset indent 256>>>BOOT 257DIAGNOSTIC SUPERVISOR. ZZ-ESSAA-X5.0-119 23-JAN-1980 12:44:40.03 258DS>ATTACH DW780 SBI DW0 3 5 259DS>ATTACH RK611 DMA 260DS>ATTACH RK07 DW0 DMA0 261DS>SELECT DMA0 262DS>LOAD EVRAC 263DS>START/SEC:PACKINIT 264.Ed 265.Ss Formatting an RP0X 266Follow the above procedures except that the 267ATTACH and SELECT lines should read: 268.Bd -literal -offset indent 269DS>ATTACH RH780 SBI RH0 8 5 270DS>ATTACH RP0X RH0 DBA0 (RP0X is, e.g., RP06) 271DS>SELECT DBA0 272.Ed 273.Pp 274This is for drive 0 on mba0; use 9 instead of 8 for mba1, etc. 275.Ss Formatting an RM0X 276Follow the above procedures except that the 277ATTACH and SELECT lines should read: 278.Bd -literal -offset indent 279DS>ATTACH RH780 SBI RH0 8 5 280DS>ATTACH RM0X RH0 DRA0 281DS>SELECT DRA0 282.Ed 283.Pp 284Don't forget to put your UNIX console floppy back in the floppy disk 285drive. 286.Sh SEE ALSO 287.Xr bad144 8 , 288.Xr badsect 8 , 289.Xr newfs 8 290.Sh BUGS 291An equivalent facility should be available which operates under a 292running UNIX system. 293.Pp 294It should be possible to reformat or verify part or all of a disk, 295then update the existing bad sector table. 296