Commit | Line | Data |
---|---|---|
14955f05 KB |
1 | .\" Copyright (c) 1985 The Regents of the University of California. |
2 | .\" All rights reserved. | |
092078c2 | 3 | .\" |
e0779a71 | 4 | .\" %sccs.include.redist.man% |
14955f05 | 5 | .\" |
e0779a71 | 6 | .\" @(#)badsect.8 6.3 (Berkeley) %G% |
092078c2 | 7 | .\" |
036e6143 | 8 | .TH BADSECT 8 "" |
092078c2 KM |
9 | .UC 4 |
10 | .SH NAME | |
11 | badsect \- create files to contain bad sectors | |
12 | .SH SYNOPSIS | |
13 | .B /etc/badsect | |
c7d258c2 | 14 | bbdir sector ... |
092078c2 KM |
15 | .SH DESCRIPTION |
16 | .I Badsect | |
17 | makes a file to contain a bad sector. Normally, bad sectors | |
18 | are made inaccessible by the standard formatter, which provides | |
19 | a forwarding table for bad sectors to the driver; see | |
20 | .IR bad144 (8) | |
21 | for details. | |
22 | If a driver supports the bad blocking standard it is much preferable to | |
23 | use that method to isolate bad blocks, since the bad block forwarding | |
24 | makes the pack appear perfect, and such packs can then be copied with | |
c7d258c2 | 25 | .IR dd (1). |
092078c2 KM |
26 | The technique used by this program is also less general than |
27 | bad block forwarding, as | |
28 | .I badsect | |
29 | can't make amends for | |
30 | bad blocks in the i-list of file systems or in swap areas. | |
31 | .PP | |
c7d258c2 KM |
32 | On some disks, |
33 | adding a sector which is suddenly bad to the bad sector table | |
34 | currently requires the running of the standard DEC formatter. | |
35 | Thus to deal with a newly bad block | |
092078c2 KM |
36 | or on disks where the drivers |
37 | do not support the bad-blocking standard | |
38 | .I badsect | |
c7d258c2 | 39 | may be used to good effect. |
092078c2 KM |
40 | .PP |
41 | .I Badsect | |
42 | is used on a quiet file system in the following way: | |
43 | First mount the file system, and change to its root directory. | |
c7d258c2 KM |
44 | Make a directory BAD there. Run |
45 | .I badsect | |
46 | giving as argument the BAD directory followed by | |
47 | all the bad sectors you wish to add. | |
48 | (The sector numbers must be relative to the beginning of | |
49 | the file system, but this is not hard as the system reports | |
50 | relative sector numbers in its console error messages.) | |
092078c2 KM |
51 | Then change back to the root directory, unmount the file system |
52 | and run | |
53 | .IR fsck (8) | |
54 | on the file system. The bad sectors should show up in two files | |
55 | or in the bad sector files and the free list. Have | |
56 | .I fsck | |
57 | remove files containing the offending bad sectors, but | |
58 | .B "do not" | |
59 | have it remove the BAD/\fInnnnn\fR files. | |
60 | This will leave the bad sectors in only the BAD files. | |
61 | .PP | |
62 | .I Badsect | |
63 | works by giving the specified sector numbers in a | |
64 | .IR mknod (2) | |
65 | system call, | |
c7d258c2 | 66 | creating an illegal file whose first block address is the block containing |
092078c2 | 67 | bad sector and whose name is the bad sector number. |
c7d258c2 KM |
68 | When it is discovered by |
69 | .I fsck | |
70 | it will ask ``HOLD BAD BLOCK''? | |
71 | A positive response will cause | |
72 | .I fsck | |
73 | to convert the inode to a regular file containing the bad block. | |
092078c2 | 74 | .SH SEE ALSO |
c7d258c2 KM |
75 | bad144(8), |
76 | fsck(8), | |
77 | format(8V) | |
78 | .SH DIAGNOSTICS | |
79 | .I Badsect | |
80 | refuses to attach a block that | |
81 | resides in a critical area or is out of range of the file system. | |
82 | A warning is issued if the block is already in use. | |
092078c2 | 83 | .SH BUGS |
c7d258c2 | 84 | If more than one sector which comprise a file system fragment are bad, |
092078c2 KM |
85 | you should specify only one of them to |
86 | .I badsect, | |
c7d258c2 KM |
87 | as the blocks in the bad sector files actually cover all the sectors in a |
88 | file system fragment. |