BSD 4_1c_2 development
[unix-history] / usr / man / man8 / bad144.8
CommitLineData
7013c8c9
C
1.TH BAD144 8 "4 February 1983"
2.UC 4
3.SH NAME
4bad144 \- read/write dec standard 144 bad sector information
5.SH SYNOPSIS
6.B bad144
7[
8.B \-f
9]
10disktype disk
11[ sno [
12bad ...
13] ]
14.SH DESCRIPTION
15.I Bad144
16can be used to inspect the information stored on a disk that is used by
17the disk drivers to implement bad sector forwarding. The format of
18the information is specified by DEC standard 144, as follows.
19.PP
20The bad sector information is located in the first 5 even numbered sectors
21of the last track of the disk pack. There are five identical copies of
22the information, described by the
23.I dkbad
24structure.
25.PP
26Replacement sectors are allocated starting with the first sector before
27the bad sector information and working backwards towards the beginning
28of the disk. A maximum of 126 bad sectors are supported. The position
29of the bad sector in the bad sector table determines which replacement
30sector it corresponds to.
31.PP
32The bad sector information and replacement sectors are conventionally
33only accessable through the ``c'' file system partition of the disk. If
34that partition is used for a file system, the user is responsible for
35making sure that it does not overlap the bad sector information or any
36replacement sectors.
37.PP
38The bad sector structure is as follows:
39.PP
40.ta .75i 1.5i 3.5i
41.nf
42struct dkbad {
43 long bt_csn; /* cartridge serial number */
44 u_short bt_mbz; /* unused; should be 0 */
45 u_short bt_flag; /* -1 => alignment cartridge */
46 struct bt_bad {
47 u_short bt_cyl; /* cylinder number of bad sector */
48 u_short bt_trksec; /* track and sector number */
49 } bt_bad[126];
50};
51.fi
52.PP
53Unused slots in the
54.I bt_bad
55array are filled with all bits set, a putatively
56illegal value.
57.PP
58.I Bad144
59is invoked by giving a device type (e.g. rk07, rm03, rm05, etc.), and a device
60name (e.g. hk0, hp1, etc.). It reads the first sector of the last track
61of the corresponding disk and prints out the bad sector information.
62It may also be invoked giving a serial number for the pack and a list
63of bad sectors, and will then write the supplied information onto the
64same location. Note, however, that
65.I bad144
66does not arrange for the specified sectors to be marked bad in this case.
67This option should only be used to restore known bad sector information which
68was destroyed.
69.PP
70If the disk is an RP06, the
71.B \-f
72option may be used to mark the bad sectors as ``bad''.
73Otherwise,
74new bad sectors can be added only
75by running the standard DEC formatter in
76section ``bad''.
77.SH SEE ALSO
78badsect(8),
79format(8)
80.SH BUGS
81It should be possible to both format disks on-line under UNIX and to change
82the bad sector information, marking new bad sectors, without running
83a standalone program.
84.PP
85The standard bootstrap drivers used to boot the system do
86not understand bad sectors,
87handle ECC errors, or the special SSE (skip sector) errors of RM80 type disks.
88This means that none of these errors can occur when reading the file
89/vmunix to boot. When a disk drive is used to load the bootstrap code
90(the alternative would be that the bootstrap would be loaded from the console
91media), sector 0 of the disk drive and the file /boot in the root file
92system of that drive must also not have any of these errors in it.
93.PP
94The drivers which write a system core image on disk after a crash do not
95handle errors; thus the crash dump area must be free of errors and bad
96sectors.