FORMAT(8V) UNIX Programmer's Manual FORMAT(8V) NAME format - how to format disk packs DESCRIPTION There are two ways to format disk packs. The simplest is to use the _f_o_r_m_a_t program. The alternative is to use the DEC standard formatting software which operates under the DEC diagnostic supervisor. This manual page describes the opera- tion of _f_o_r_m_a_t, then concludes with some remarks about using the DEC formatter. _F_o_r_m_a_t is a standalone program used to format and check disks prior to constructing file systems. In addition to the formatting operation, _f_o_r_m_a_t records any bad sectors encountered according to DEC standard 144. Formatting is performed one track at a time by writing the appropriate headers and a test pattern and then checking the sector by reading and verifying the pattern, using the controller's ECC for error detection. A sector is marked bad if an unre- coverable media error is detected, or if a correctable ECC error too many bits in length is detected (such errors are indicated as ``ECC'' in the summary printed upon completing the format operation). After the entire disk has been for- matted and checked, the total number of errors are reported, any bad sectors and skip sectors are marked, and a bad sec- tor forwarding table is written to the disk in the first five even numbered sectors of the last track. It is also possible to reformat sections of the disk in units of tracks. _F_o_r_m_a_t may be used on any UNIBUS or MASSBUS drive supported by the _u_p and _h_p device drivers which uses 4-byte headers (everything except RP's). The test pattern used during the media check may be selected from one of: 0xf00f (RH750 worst case), 0xec6d (media worst case), and 0xa5a5 (alternating 1's and 0's). Normally the media worst case pattern is used. _F_o_r_m_a_t also has an option to perform an extended "severe burn-in," which makes a number of passes using different patterns. The number of passes can be selected at run time, up to a maximum of 48, with provision for additional passes or termination after the preselected number of passes. This test runs for many hours, depending on the disk and proces- sor. Each time _f_o_r_m_a_t is run to format an entire disk, a com- pletely new bad sector table is generated based on errors encountered while formatting. The device driver, however, will always attempt to read any existing bad sector table when the device is first opened. Thus, if a disk pack has never previously been formatted, or has been formatted with different sectoring, five error messages will be printed Printed 11/26/99 May 22, 1986 1 FORMAT(8V) UNIX Programmer's Manual FORMAT(8V) when the driver attempts to read the bad sector table; these diagnostics should be ignored. Formatting a 400 megabyte disk on a MASSBUS disk controller usually takes about 20 minutes. Formatting on a UNIBUS disk controller takes significantly longer. For every hundredth cylinder formatted _f_o_r_m_a_t prints a message indicating the current cylinder being formatted. (This message is just to reassure people that nothing is is amiss.) _F_o_r_m_a_t uses the standard notation of the standalone I/O library in identifying a drive to be formatted. A drive is specified as _z_z(_x,_y), where _z_z refers to the controller type (either _h_p or _u_p), _x is the unit number of the drive; 8 times the UNIBUS or MASSBUS adaptor number plus the MASSBUS drive number or UNIBUS drive unit number; and _y is the file system partition on drive _x (this should always be 0). For example, ``hp(1,0)'' indicates that drive 1 on MASSBUS adap- tor 0 should be formatted; while ``up(10,0)'' indicates that UNIBUS drive 2 on UNIBUS adaptor 1 should be formatted. Before each formatting attempt, _f_o_r_m_a_t prompts the user in case debugging should be enabled in the appropriate device driver. A carriage return disables debugging information. _F_o_r_m_a_t should be used prior to building file systems (with _n_e_w_f_s(8)) to insure that all sectors with uncorrectable media errors are remapped. If a drive develops uncorrect- able defects after formatting, either _b_a_d_1_4_4(8) or _b_a_d_- _s_e_c_t(8) should be able to avoid the bad sectors. EXAMPLE A sample run of _f_o_r_m_a_t is shown below. In this example (using a VAX-11/780), _f_o_r_m_a_t is loaded from the console floppy; on an 11/750 _f_o_r_m_a_t will be loaded from the root file system with _b_o_o_t(8) following a "B/3" command. Bold- face means user input. As usual, ``#'' and ``@'' may be used to edit input. >>>L FORMAT LOAD DONE, 00004400 BYTES LOADED >>>S 2 Disk format/check utility Enable debugging (0=none, 1=bse, 2=ecc, 3=bse+ecc)? 0 Device to format? hp(8,0) (_e_r_r_o_r _m_e_s_s_a_g_e_s _m_a_y _o_c_c_u_r _a_s _o_l_d _b_a_d _s_e_c_t_o_r _t_a_b_l_e _i_s _r_e_a_d) Formatting drive hp0 on adaptor 1: verify (yes/no)? yes Device data: #cylinders=842, #tracks=20, #sectors=48 Starting cylinder (0): Starting track (0): Ending cylinder (841): Printed 11/26/99 May 22, 1986 2 FORMAT(8V) UNIX Programmer's Manual FORMAT(8V) Ending track (19): Available test patterns are: 1 - (f00f) RH750 worst case 2 - (ec6d) media worst case 3 - (a5a5) alternating 1's and 0's 4 - (ffff) Severe burnin (up to 48 passes) Pattern (one of the above, other to restart)? 2 Maximum number of bit errors to allow for soft ECC (3): Start formatting...make sure the drive is online ... (_s_o_f_t _e_c_c'_s _a_n_d _o_t_h_e_r _e_r_r_o_r_s _a_r_e _r_e_p_o_r_t_e_d _a_s _t_h_e_y _o_c_c_u_r) ... (_i_f _4 _w_r_i_t_e _c_h_e_c_k _e_r_r_o_r_s _w_e_r_e _f_o_u_n_d, _t_h_e _p_r_o_g_r_a_m _t_e_r_m_i_n_a_t_e_s _l_i_k_e _t_h_i_s...) ... Errors: Bad sector: 0 Write check: 4 Hard ECC: 0 Other hard: 0 Marked bad: 0 Skipped: 0 Total of 4 hard errors revectored. Writing bad sector table at block 808272 (_8_0_8_2_7_2 _i_s _t_h_e _b_l_o_c_k # _o_f _t_h_e _f_i_r_s_t _b_l_o_c_k _i_n _t_h_e _b_a_d _s_e_c_t_o_r _t_a_b_l_e) Done (..._p_r_o_g_r_a_m _r_e_s_t_a_r_t_s _t_o _a_l_l_o_w _f_o_r_m_a_t_t_i_n_g _o_t_h_e_r _d_i_s_k_s) (..._t_o _a_b_o_r_t _h_a_l_t _m_a_c_h_i_n_e _w_i_t_h ^_P) DIAGNOSTICS The diagnostics are intended to be self explanatory. USING DEC SOFTWARE TO FORMAT Warning: These instructions are for people with 11/780 CPU's. The steps needed for 11/750 or 11/730 cpu's are simi- lar, but not covered in detail here. The formatting procedures are different for each type of disk. Listed here are the formatting procedures for RK07's, RP0X, and RM0X disks. You should shut down UNIX and halt the machine to do any disk formatting. Make certain you put in the pack you want formatted. It is also a good idea to spin down or write protect the disks you don't want to format, just in case. Formatting an RK07. Load the console floppy labeled, "RX11 VAX DSK LD DEV #1" in the console disk drive, and type the following commands: >>>BOOT DIAGNOSTIC SUPERVISOR. ZZ-ESSAA-X5.0-119 23-JAN-1980 12:44:40.03 DS>ATTACH DW780 SBI DW0 3 5 Printed 11/26/99 May 22, 1986 3 FORMAT(8V) UNIX Programmer's Manual FORMAT(8V) DS>ATTACH RK611 DMA DS>ATTACH RK07 DW0 DMA0 DS>SELECT DMA0 DS>LOAD EVRAC DS>START/SEC:PACKINIT Formatting an RP0X. Follow the above procedures except that the ATTACH and SELECT lines should read: DS>ATTACH RH780 SBI RH0 8 5 DS>ATTACH RP0X RH0 DBA0(RP0X is, e.g. RP06) DS>SELECT DBA0 This is for drive 0 on mba0; use 9 instead of 8 for mba1, etc. Formatting an RM0X. Follow the above procedures except that the ATTACH and SELECT lines should read: DS>ATTACH RH780 SBI RH0 8 5 DS>ATTACH RM0X RH0 DRA0 DS>SELECT DRA0 Don't forget to put your UNIX console floppy back in the floppy disk drive. SEE ALSO bad144(8), badsect(8), newfs(8) BUGS An equivalent facility should be available which operates under a running UNIX system. It should be possible to reformat or verify part or all of a disk, then update the existing bad sector table. Printed 11/26/99 May 22, 1986 4