version 2, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
BADBLOCKS |
|
|
2 |
!!!BADBLOCKS |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
WARNING |
|
|
8 |
AUTHOR |
|
|
9 |
AVAILABILITY |
|
|
10 |
SEE ALSO |
|
|
11 |
---- |
|
|
12 |
!!NAME |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
badblocks - search a device for bad blocks |
|
|
16 |
!!SYNOPSIS |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
__badblocks__ [[ __-svwnf__ ] [[ __-b__ |
|
|
20 |
''block-size'' ] [[ __-c__ ''blocks_at_once'' ] [[ |
|
|
21 |
__-i__ ''input_file'' ] [[ __-o__ ''output_file'' |
|
|
22 |
] [[ __-p__ ''num_passes'' ] ''device'' [[ |
|
|
23 |
''last-block'' ] [[ ''start-block'' ] |
|
|
24 |
!!DESCRIPTION |
|
|
25 |
|
|
|
26 |
|
|
|
27 |
__badblocks__ is used to search for bad blocks on a |
|
|
28 |
device (usually a disk partition). ''device'' is the |
|
|
29 |
special file corresponding to the device (e.g |
|
|
30 |
''/dev/hdc1''). ''last-block'' is the last block to be |
|
|
31 |
checked; if it is not specified, the last block on the |
|
|
32 |
device is used as a default. ''start-block'' is an |
|
|
33 |
optional parameter specifying the starting block number for |
|
|
34 |
the test, which allows the testing to start in the middle of |
|
|
35 |
the disk. If it is not specified the first block on the disk |
|
|
36 |
is used as a default. |
|
|
37 |
|
|
|
38 |
|
|
|
39 |
__Important note:__ If the output of __badblocks__ is |
|
|
40 |
going to be fed to the __e2fsck__ or __mke2fs__ |
|
|
41 |
programs, it is important that the block size is properly |
|
|
42 |
specified, since the block numbers which are generated is |
|
|
43 |
very dependent on the block size in use. For this reason, it |
|
|
44 |
is strongly recommended that users __not__ run |
|
|
45 |
__badblocks__ directly, but rather use the __-c__ |
|
|
46 |
option of the __e2fsck__ and __mke2fs__ |
|
|
47 |
programs. |
|
|
48 |
!!OPTIONS |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
__-b__ ''block-size'' |
|
|
52 |
|
|
|
53 |
|
|
|
54 |
Specify the size of blocks in bytes. |
|
|
55 |
|
|
|
56 |
|
|
|
57 |
__-c__ ''number of blocks'' |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
is the number of blocks which are tested at a time. The |
|
|
61 |
default is 16. Increasing this number will increase the |
|
|
62 |
efficiency of __badblocks__ but also will increase its |
|
|
63 |
memory usage. __Badblocks__ needs memory proportional to |
|
|
64 |
the number of blocks tested at once, in read-only mode, |
|
|
65 |
proportional to twice that number in read-write mode, and |
|
|
66 |
proportional to three times that number in non-destructive |
|
|
67 |
read-write mode. If you set the number-of-blocks parameter |
|
|
68 |
to too high a value, __badblocks__ will exit almost |
|
|
69 |
immediately with an out-of-memory error |
|
|
70 |
__ |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
__-f__ |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
Normally, badblocks will refuse to do a read/write or a |
|
|
77 |
non-destructive test on a device which is mounted, since |
|
|
78 |
either can cause the system to potentially crash; even a |
|
|
79 |
non-destructive test can damage a mounted filesystem. This |
|
|
80 |
can be overriden using the __-f__ flag, but should almost |
|
|
81 |
never be used --- if you think you're smarter than the |
|
|
82 |
__badblocks__ program, you almost certainly aren't. The |
|
|
83 |
only time when this option might be safe to use is if the |
|
|
84 |
/etc/mtab file is incorrect, and the device really isn't |
|
|
85 |
mounted. |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
__-i__ ''input_file'' |
|
|
89 |
|
|
|
90 |
|
|
|
91 |
Read a list of already existing known bad blocks. |
|
|
92 |
__Badblocks__ will skip testing these blocks since they |
|
|
93 |
are known to be bad. If ''input_file'' is specified as |
|
|
94 |
''new'' bad blocks produced on the standard |
|
|
95 |
output or in the output file. The __-b__ option of |
2 |
perry |
96 |
dumpe2fs(8) can be used to retrieve the list of |
1 |
perry |
97 |
blocks currently marked bad on an existing filesystem, in a |
|
|
98 |
format suitable for use with this option. |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
__-o__ ''output_file'' |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
Write the list of bad blocks to the specified file. Without |
|
|
105 |
this option, __badblocks__ displays the list on its |
|
|
106 |
standard output. The format of this file is suitable for use |
2 |
perry |
107 |
by the __-l__ option in e2fsck(8) or |
|
|
108 |
mke2fs(8). |
1 |
perry |
109 |
|
|
|
110 |
|
|
|
111 |
__-p__ ''num_passes'' |
|
|
112 |
|
|
|
113 |
|
|
|
114 |
Repeat scanning the disk until there are no new blocks |
|
|
115 |
discovered in num_passes consecutive scans of the disk. |
|
|
116 |
Default is 0, meaning __badblocks__ will exit after the |
|
|
117 |
first pass. |
|
|
118 |
|
|
|
119 |
|
|
|
120 |
__-n__ |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
Use non-destructive read-write mode. By default only a |
|
|
124 |
non-destructive read-only test is done. This option must not |
|
|
125 |
be combined with the __-w__ option, as they are mutually |
|
|
126 |
exclusive. |
|
|
127 |
|
|
|
128 |
|
|
|
129 |
__-s__ |
|
|
130 |
|
|
|
131 |
|
|
|
132 |
Show the progress of the scan by writing out the block |
|
|
133 |
numbers as they are checked. |
|
|
134 |
|
|
|
135 |
|
|
|
136 |
__-v__ |
|
|
137 |
|
|
|
138 |
|
|
|
139 |
Verbose mode. |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
__-w__ |
|
|
143 |
|
|
|
144 |
|
|
|
145 |
Use write-mode test. With this option, __badblocks__ |
|
|
146 |
scans for bad blocks by writing some patterns (0xaa, 0x55, |
|
|
147 |
0xff, 0x00) on every block of the device, reading every |
|
|
148 |
block and comparing the contents. This option may not be |
|
|
149 |
combined with the __-n__ option, as they are mutually |
|
|
150 |
exclusive. |
|
|
151 |
!!WARNING |
|
|
152 |
|
|
|
153 |
|
|
|
154 |
Never use the __-w__ option on an device containing an |
|
|
155 |
existing file system. This option erases data! If you want |
|
|
156 |
to do write-mode testing on an existing file system, use the |
|
|
157 |
__-n__ option instead. It is slower, but it will preserve |
|
|
158 |
your data. |
|
|
159 |
!!AUTHOR |
|
|
160 |
|
|
|
161 |
|
|
|
162 |
__badblocks__ was written by Remy Card |
|
|
163 |
__ |
|
|
164 |
!!AVAILABILITY |
|
|
165 |
|
|
|
166 |
|
|
|
167 |
__badblocks__ is part of the e2fsprogs package and is |
|
|
168 |
available from |
|
|
169 |
http://e2fsprogs.sourceforge.net. |
|
|
170 |
!!SEE ALSO |
|
|
171 |
|
|
|
172 |
|
2 |
perry |
173 |
e2fsck(8), __mke2fs__(8) |
1 |
perry |
174 |
---- |