manual page distributed with 4.2BSD
[unix-history] / usr / src / usr.sbin / bad144 / bad144.8
CommitLineData
c04656a2
KM
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.\"
79d6ffc9 5.\" @(#)bad144.8 5.1 (Berkeley) %G%
c04656a2 6.\"
79d6ffc9 7.TH BAD144 8 "18 July 1983"
c04656a2
KM
8.UC 4
9.SH NAME
10bad144 \- read/write dec standard 144 bad sector information
11.SH SYNOPSIS
79d6ffc9
KM
12.B /etc/bad144
13[
14.B \-f
15]
c04656a2
KM
16disktype disk
17[ sno [
18bad ...
19] ]
20.SH DESCRIPTION
21.I Bad144
22can be used to inspect the information stored on a disk that is used by
23the disk drivers to implement bad sector forwarding. The format of
24the information is specified by DEC standard 144, as follows.
25.PP
26The bad sector information is located in the first 5 even numbered sectors
27of the last track of the disk pack. There are five identical copies of
79d6ffc9
KM
28the information, described by the
29.I dkbad
30structure.
c04656a2
KM
31.PP
32Replacement sectors are allocated starting with the first sector before
33the bad sector information and working backwards towards the beginning
34of the disk. A maximum of 126 bad sectors are supported. The position
35of the bad sector in the bad sector table determines which replacement
36sector it corresponds to.
79d6ffc9 37The bad sectors must be listed in ascending order.
c04656a2
KM
38.PP
39The bad sector information and replacement sectors are conventionally
79d6ffc9 40only accessible through the ``c'' file system partition of the disk. If
c04656a2
KM
41that partition is used for a file system, the user is responsible for
42making sure that it does not overlap the bad sector information or any
43replacement sectors.
44.PP
45The bad sector structure is as follows:
46.PP
47.ta .75i 1.5i 3.5i
48.nf
49struct dkbad {
50 long bt_csn; /* cartridge serial number */
51 u_short bt_mbz; /* unused; should be 0 */
52 u_short bt_flag; /* -1 => alignment cartridge */
53 struct bt_bad {
54 u_short bt_cyl; /* cylinder number of bad sector */
55 u_short bt_trksec; /* track and sector number */
56 } bt_bad[126];
57};
58.fi
59.PP
79d6ffc9
KM
60Unused slots in the
61.I bt_bad
62array are filled with all bits set, a putatively
c04656a2
KM
63illegal value.
64.PP
65.I Bad144
66is invoked by giving a device type (e.g. rk07, rm03, rm05, etc.), and a device
67name (e.g. hk0, hp1, etc.). It reads the first sector of the last track
68of the corresponding disk and prints out the bad sector information.
69It may also be invoked giving a serial number for the pack and a list
70of bad sectors, and will then write the supplied information onto the
71same location. Note, however, that
72.I bad144
73does not arrange for the specified sectors to be marked bad in this case.
74This option should only be used to restore known bad sector information which
75was destroyed.
79d6ffc9 76It is necessary to reboot before the change will take effect.
c04656a2 77.PP
79d6ffc9
KM
78If the disk is an RP06, Fujitsu Eagle,
79or Ampex Capricorn on a Massbus, the
80.B \-f
81option may be used to mark the bad sectors as ``bad''.
82\fBNOTE: this can only be done safely when there is no other disk activity\fP,
83preferably while running single-user.
84Otherwise,
85new bad sectors can be added only
86by running a formatter.
87Note that the order in which the sectors are listed determines which sectors
88used for replacements; if new sectors are being inserted into the list on a
89drive that is in use, care should be taken that replacements for
90existing bad sectors have the correct contents.
c04656a2 91.SH SEE ALSO
79d6ffc9
KM
92badsect(8),
93format(8V)
c04656a2 94.SH BUGS
79d6ffc9 95It should be possible to format disks on-line under UNIX.
c04656a2 96.PP
79d6ffc9
KM
97It should be possible to mark bad sectors on drives of all type.
98.PP
99On an 11/750,
100the standard bootstrap drivers used to boot the system do
101not understand bad sectors,
c04656a2
KM
102handle ECC errors, or the special SSE (skip sector) errors of RM80 type disks.
103This means that none of these errors can occur when reading the file
79d6ffc9
KM
104/vmunix to boot. Sectors 0-15 of the disk drive
105must also not have any of these errors.
c04656a2
KM
106.PP
107The drivers which write a system core image on disk after a crash do not
108handle errors; thus the crash dump area must be free of errors and bad
109sectors.