| 1 | .\" Copyright (c) 1980 Regents of the University of California. |
| 2 | .\" All rights reserved. The Berkeley software License Agreement |
| 3 | .\" specifies the terms and conditions for redistribution. |
| 4 | .\" |
| 5 | .\" @(#)bad144.8 6.3 (Berkeley) %G% |
| 6 | .\" |
| 7 | .TH BAD144 8 "" |
| 8 | .UC 4 |
| 9 | .SH NAME |
| 10 | bad144 \- read/write dec standard 144 bad sector information |
| 11 | .SH SYNOPSIS |
| 12 | .B /etc/bad144 |
| 13 | [ |
| 14 | .B \-f |
| 15 | ] [ |
| 16 | .B \-c |
| 17 | ] [ |
| 18 | .B \-v |
| 19 | ] |
| 20 | disktype disk |
| 21 | [ sno [ |
| 22 | bad ... |
| 23 | ] ] |
| 24 | .br |
| 25 | .B /etc/bad144 |
| 26 | .B \-a |
| 27 | [ |
| 28 | .B \-f |
| 29 | ] [ |
| 30 | .B \-c |
| 31 | ] [ |
| 32 | .B \-v |
| 33 | ] |
| 34 | disktype disk |
| 35 | [ |
| 36 | bad ... |
| 37 | ] |
| 38 | .SH DESCRIPTION |
| 39 | .I Bad144 |
| 40 | can be used to inspect the information stored on a disk that is used by |
| 41 | the disk drivers to implement bad sector forwarding. The format of |
| 42 | the information is specified by DEC standard 144, as follows. |
| 43 | .PP |
| 44 | The bad sector information is located in the first 5 even numbered sectors |
| 45 | of the last track of the disk pack. There are five identical copies of |
| 46 | the information, described by the |
| 47 | .I dkbad |
| 48 | structure. |
| 49 | .PP |
| 50 | Replacement sectors are allocated starting with the first sector before |
| 51 | the bad sector information and working backwards towards the beginning |
| 52 | of the disk. A maximum of 126 bad sectors are supported. The position |
| 53 | of the bad sector in the bad sector table determines the replacement |
| 54 | sector to which it corresponds. |
| 55 | The bad sectors must be listed in ascending order. |
| 56 | .PP |
| 57 | The bad sector information and replacement sectors are conventionally |
| 58 | only accessible through the ``c'' file system partition of the disk. If |
| 59 | that partition is used for a file system, the user is responsible for |
| 60 | making sure that it does not overlap the bad sector information or any |
| 61 | replacement sectors. |
| 62 | Thus, one track plus 126 sectors must be reserved to allow use |
| 63 | of all of the possible bad sector replacements. |
| 64 | .PP |
| 65 | The bad sector structure is as follows: |
| 66 | .PP |
| 67 | .ta .75i 1.5i 3.5i |
| 68 | .nf |
| 69 | struct dkbad { |
| 70 | long bt_csn; /* cartridge serial number */ |
| 71 | u_short bt_mbz; /* unused; should be 0 */ |
| 72 | u_short bt_flag; /* -1 => alignment cartridge */ |
| 73 | struct bt_bad { |
| 74 | u_short bt_cyl; /* cylinder number of bad sector */ |
| 75 | u_short bt_trksec; /* track and sector number */ |
| 76 | } bt_bad[126]; |
| 77 | }; |
| 78 | .fi |
| 79 | .PP |
| 80 | Unused slots in the |
| 81 | .I bt_bad |
| 82 | array are filled with all bits set, a putatively |
| 83 | illegal value. |
| 84 | .PP |
| 85 | .I Bad144 |
| 86 | is invoked by giving a device type (e.g. rk07, rm03, rm05, etc.), and a device |
| 87 | name (e.g. hk0, hp1, etc.). With no optional arguments |
| 88 | it reads the first sector of the last track |
| 89 | of the corresponding disk and prints out the bad sector information. |
| 90 | It issues a warning if the bad sectors are out of order. |
| 91 | .I Bad144 |
| 92 | may also be invoked with a serial number for the pack and a list |
| 93 | of bad sectors. |
| 94 | It will write the supplied information into all copies |
| 95 | of the bad-sector file, replacing any previous information. |
| 96 | Note, however, that |
| 97 | .I bad144 |
| 98 | does not arrange for the specified sectors to be marked bad in this case. |
| 99 | This procedure should only be used to restore known bad sector information which |
| 100 | was destroyed. |
| 101 | It is necessary to reboot before any change will take effect. |
| 102 | .PP |
| 103 | With the |
| 104 | .B \-a |
| 105 | option, |
| 106 | the argument list consists of new bad sectors to be added to an existing |
| 107 | list. |
| 108 | The new sectors are sorted into the list, |
| 109 | which must have been in order. |
| 110 | Replacement sectors are moved to accommodate the additions; |
| 111 | the new replacement sectors are cleared. |
| 112 | The entire process is described as it happens in gory detail if |
| 113 | .B \-v |
| 114 | (verbose) is given. |
| 115 | The |
| 116 | .B \-c |
| 117 | option forces an attempt to copy the old sector to the replacement, |
| 118 | and may be useful when replacing an unreliable sector. |
| 119 | .PP |
| 120 | If the disk is an RP06, RM03, RM05, Fujitsu Eagle, |
| 121 | or SMD disk on a Massbus, the |
| 122 | .B \-f |
| 123 | option may be used to mark the new bad sectors as ``bad'' |
| 124 | by reformatting them as unusable sectors. |
| 125 | \fBNOTE: this can be done safely only when there is no other disk activity\fP, |
| 126 | preferably while running single-user. |
| 127 | This option is required unless the sectors have already been marked bad, |
| 128 | or the system will not be notified that it should use the replacement sector. |
| 129 | .SH SEE ALSO |
| 130 | badsect(8), |
| 131 | format(8V) |
| 132 | .SH BUGS |
| 133 | It should be possible to format disks on-line under UNIX. |
| 134 | .PP |
| 135 | It should be possible to mark bad sectors on drives of all type. |
| 136 | .PP |
| 137 | On an 11/750, |
| 138 | the standard bootstrap drivers used to boot the system do |
| 139 | not understand bad sectors, |
| 140 | handle ECC errors, or the special SSE (skip sector) errors of RM80-type disks. |
| 141 | This means that none of these errors can occur when reading the file |
| 142 | /vmunix to boot. Sectors 0-15 of the disk drive |
| 143 | must also not have any of these errors. |
| 144 | .PP |
| 145 | The drivers which write a system core image on disk after a crash do not |
| 146 | handle errors; thus the crash dump area must be free of errors and bad |
| 147 | sectors. |