*BSD News Article 78631


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.vbc.net!alpha.sky.net!buffnet2.buffnet.net!news3.buffnet.net!www.nntp.primenet.com!nntp.primenet.com!news.sprintlink.net!news-peer.sprintlink.net!newsfeed.internetmci.com!netnews.nwnet.net!symiserver2.symantec.com!usenet
From: tedm@agora.rdrop.com
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: How to fix Bad Bad Sector Table?
Date: 19 Sep 1996 06:52:43 GMT
Organization: Symantec Corporation
Lines: 63
Message-ID: <51qqjr$gol@symiserver2.symantec.com>
References: <199609181458.OAA10275@email.croughton.af.mil>
Reply-To: tedm@agora.rdrop.com
NNTP-Posting-Host: 198.6.34.1
X-Newsreader: IBM NewsReader/2 v1.2.5

In <199609181458.OAA10275@email.croughton.af.mil>, "Scot W. Hetzel" <hetzels@croughton.af.mil> writes:
>I tried booting up my system but, it advies that I have a Bad Bad sector
>Table, and will not mount the Root partition.  How do you fix a Bad Sector
>Table?
>
>Scot Hetzel

Cry? :-)

Actually, first you boot with a fixit floppy and attempt to run fsck.  If this
works, great.  If, however, you really and truly have one or more bad sectors
on your disk, you have no choice but to reinstall and restore from backups
with one addition, you MUST do bad sector scanning.

FreeBSD, like most Unixin, assumes a _perfect_ disk drive.  With modern SCSI
disk drives, this is no problem, since the disk will silently remap failing sectors
on the fly, without informing the operating system of it.  Older SCSI disks might
not do this so occassionally you might get this error, instead they would build
lists of failed sectors.  A reformat using the SCSI adapter card manufacturers
formatting utilities would usually update the defect table and make the drive
"perfect" again.

IDE drives, on the other hand, many times don't do this, instead they report
that sector so-and-so has failed, and the operating system needed to deal
with it.  (I think that there are some IDE drives that do remap on the fly, though)
With manufacturing tolerances on modern IDE drives being what they are, it is
normal for IDE drives to be perfectly pure, with no bad sectors.  Occassionally
you might run across a bad one here or there, but that's it.  In my experience
IDE drives that have lots of bad sectors are usually about ready to lock up
solid.

When you install FreeBSD in the Partition Editor there is an option to enable
bad block scanning on the disk.  This is a special trick (that must be supported
by the disk adapter driver, by the way) that uses the bad144 program.
Basically, bad144 scans the disk and builds a list of bad partition entries, then
writes this list on a special place on the disk.  When the FreeBSD machine
boots, it reads the bad sector table that bad144 has created and the disk adapter
driver maps out those sectors, which gives the illusion of a perfect disk to the
operating system and everyone is happy.

There are three problems with bad144 though.  First, it must be supported by
the disk adapter driver, currently the wd driver is the only one that supports
it I believe.  This is the driver used for IDE disks.  Next, bad144 only works if
the entire disk can be represented _under_ the 1024 cylinder boundary
inherent in BIOS.  Last, it makes some of the disk tools such as disklabel
and newfs act very weird.

Because of this, people with IDE drives that want to run FreeBSD will usually
check the drive to make sure it is perfect, then load FreeBSD and forgo the
bad sector scanning, then cross their fingers and hope that the drive doesen't
develop bad sectors before it becomes obsolete. (which is usually a good bet
with modern IDE drives)

If you are one of the unfortunate people that have an IDE disk with one or two
bad sectors, you will have to use bad sector scanning, which means you will
need to re-do your partitions, and enable it during the FreeBSD installation.
Of course, if you had an existing FreeBSD installation on a disk and one of it's
sectors gave out that happened to hold some important filesystem data the
filesystem is going to be wrecked.  Needless to say, when you redo your partitons
you will need to make them "compatible with existing partitions" as well as making
sure the geometry matches the translated geometry in the BIOS.

Ted