Subject: Seeking the truth about bad sectors
To: None <netbsd-users@netbsd.org>
From: Jim Breton <jamesb-netbsd@alongtheway.com>
List: netbsd-users
Date: 11/14/2001 06:43:23
What is the story with scanning/re-mapping bad sectors on IDE drives?

I have done Google searches, asked on IRC, read various web pages.. and
I get conflicting views and explanations making it difficult to
determine which to trust as correct.

First, I should mention that I started my *nix experience on Linux.
Linux has a "badblocks" tool which can scan a drive for bad sectors, and
handle the re-mapping for you.  I have used this with success in the
past, after suffering some drive problems it did correctly identify and
deal with the issue.

On NetBSD (i386) I see the bad144 and badsect tools; however, neither of
these appears to do an actual _scan_ of a device for bad blocks.  It
looks to me like the assumption is being made that the IDE controller
(or drive?) will handle the detection and re-mapping of the sectors.  Is
this the case?

However, is there really such a guarantee, even with fairly modern IDE
drives?  i.e., is there really no way for bad sectors to develop and go
undetected by the hardware?  If so, why do Linux and Windows include
utilities to perform such a scan anytime you want?  And why do Linux's
"badblocks" and Win's scandisk find bad blocks at all, if this is
handled in hardware transparent to the OS?  (And to add to the
confusion, badblocks's man page also says that IDE drives will handle
this in hardware.)

Also, what would one do on SCSI devices?

Thanks.