Remove a beautifully detailed, helpful, lengthy explanation of how to

use bad144 with bad blocks on disks.

I asked the original author about this in 2001, and he said this text
was old and irrelevant at the time.  Four years on, it's even more
irrelevant.
This commit is contained in:
Michael Lucas 2005-05-12 16:11:47 +00:00
parent 5d0743fb63
commit 4f4cce4170
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=24547

View file

@ -2907,11 +2907,11 @@ File: +DESC (ignored)</screen>
<answer> <answer>
<para>With SCSI drives, the drive should be capable of re-mapping <para>With SCSI drives, the drive should be capable of re-mapping
these automatically. However, many drives are shipped with these automatically. However, many drives ship with
this feature disabled, for some mysterious reason...</para> this feature disabled.</para>
<para>To enable this, you will need to edit the first device page <para>To enable bad block remapping edit the first device page
mode, which can be done on FreeBSD by giving the command mode, which can be done by giving the command
(as <username>root</username>)</para> (as <username>root</username>)</para>
<screen>&prompt.root; <userinput>camcontrol modepage sd0 -m 1 -e -P 3</userinput></screen> <screen>&prompt.root; <userinput>camcontrol modepage sd0 -m 1 -e -P 3</userinput></screen>
@ -2921,87 +2921,15 @@ File: +DESC (ignored)</screen>
<programlisting>AWRE (Auto Write Reallocation Enbld): 1 <programlisting>AWRE (Auto Write Reallocation Enbld): 1
ARRE (Auto Read Reallocation Enbld): 1</programlisting> ARRE (Auto Read Reallocation Enbld): 1</programlisting>
<para>The following paragraphs were submitted by Ted Mittelstaedt <para>Modern IDE drives also have bad block remapping
<email>tedm@toybox.placo.com</email>:</para> features in the controller, and they ship with this
feature turned on.</para>
<para>For IDE drives, any bad block is usually a sign of <para>If you see warnings about bad blocks (on either type
potential trouble. All modern IDE drives come with internal of drive), it is time to consider replacing the drive.
bad-block remapping turned on. All IDE hard drive manufacturers You might be able to use the drive manufacturer's
today offer extensive warranties and will replace drives with diagnostic program to lock out those bad blocks, but at
bad blocks on them.</para> best this will buy you some time.</para>
<para>If you still want to attempt to rescue an IDE drive with
bad blocks, you can attempt to download the IDE drive
manufacturer's IDE diagnostic program, and run this against the
drive. Sometimes these programs can be set to force the drive
electronics to rescan the drive for bad blocks and lock them
out.</para>
<para>For ESDI, RLL and MFM drives, bad blocks are a normal part
of the drive and are no sign of trouble, generally. With a PC,
the disk drive controller card and BIOS handle the task of
locking out bad sectors. This is fine for operating systems
like DOS that use BIOS code to access the disk. However,
FreeBSD's disk driver does not go through the BIOS, therefore a
mechanism, bad144, exists that replaces this functionality.
bad144 only works with the wd driver (which means it is not
supported in FreeBSD 4.0), it is <emphasis>not</emphasis> able to be used with SCSI.
bad144 works by entering all bad sectors found into a special
file.</para>
<para>One caveat with bad144 - the bad block special file is
placed on the last track of the disk. As this file may possibly
contain a listing for a bad sector that would occur near the
beginning of the disk, where the /kernel file might be located,
it therefore must be accessible to the bootstrap program that
uses BIOS calls to read the kernel file. This means that the
disk with bad144 used on it must not exceed 1024 cylinders, 16
heads, and 63 sectors. This places an effective limit of 500MB
on a disk that is mapped with bad144.</para>
<para>To use bad144, simply set the <quote>Bad Block</quote>
scanning to ON in the FreeBSD fdisk screen during the initial
install. This works up through FreeBSD 2.2.7. The disk must
have less than 1024 cylinders. It is generally recommended that
the disk drive has been in operation for at least 4 hours prior
to this to allow for thermal expansion and track
wandering.</para>
<para>If the disk has more than 1024 cylinders (such as a large
ESDI drive) the ESDI controller uses a special translation mode
to make it work under DOS. The wd driver understands about
these translation modes, IF you enter the
<quote>translated</quote> geometry with the <quote>set
geometry</quote> command in fdisk. You must also NOT use the
<quote>dangerously dedicated</quote> mode of creating the
FreeBSD partition, as this ignores the geometry. Also, even
though fdisk will use your overridden geometry, it still knows
the true size of the disk, and will attempt to create a too
large FreeBSD partition. If the disk geometry is changed to the
translated geometry, the partition MUST be manually created
with the number of blocks.</para>
<para>A quick trick to use is to set up the large ESDI disk
with the ESDI controller, boot it with a DOS disk and
format it with a DOS partition. Then, boot the FreeBSD
install and in the fdisk screen, read off and write down
the blocksize and block numbers for the DOS
partition. Then, reset the geometry to the same that DOS
uses, delete the DOS partition, and create a
<quote>cooperative</quote> FreeBSD partition using the
blocksize you recorded earlier. Then, set the partition
bootable and turn on bad block scanning. During the actual
install, bad144 will run first, before any filesystems are
created (you can view this with an <keycombo
action="simul"><keycap>Alt</keycap><keycap>F2</keycap></keycombo>).
If it has any trouble creating the badsector file, you
have set too large a disk geometry - reboot the system and
start all over again (including repartitioning and
reformatting with DOS).</para>
<para>If remapping is enabled and you are seeing bad blocks,
consider replacing the drive. The bad blocks will only get
worse as time goes on.</para>
</answer> </answer>
</qandaentry> </qandaentry>