Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jan 2003 21:53:55 -0500 (EST)
From:      John Mills <jmills@speakeasy.net>
To:        Marc Schneiders <marc@schneiders.org>
Cc:        Lowell Gilbert <freebsd-questions-local@be-well.no-ip.com>, <questions@FreeBSD.ORG>
Subject:   Re: How to map bad sectors on IDE?
Message-ID:  <Pine.LNX.4.44.0301312140280.4225-100000@localhost.localdomain>
In-Reply-To: <44lm10g7a8.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Marc -

On 31 Jan 2003, Lowell Gilbert wrote:

> Marc Schneiders <marc@schneiders.org> writes:
> 
> > I have searched Google to find a solution to mark off these two
> > blocks/inodes (or however I should call them), so that they will not
> > be used anymore. All I found is that this is not possible on
> > IDE.

It is possible with some types of Linux filesystems (ext2 for one), and
'e2fsck' can be told to run a block-by-block read-write test across the
disk (optionally preserving original data where possible), then add any
bad blocks to a suitably named file which exists just to keep bad blocks
out of circulation. 'apropos badblocks' and 'man fsck' failed to suggest
such a function in fBSD, but it might be worth more looking. Such an
operation would cost you only those files which are now corrupted - when
it happened to me I lost a block in a text file, 'fsck' moved the
fragments to 'lost+found', and I was able to reconstruct the file.  That
was pure luck, naturally.

> Why is it radical?  After all, IDE disks already do bad-block
> remapping internally, so you've built up a *lot* of bad sectors
> already if they're starting to become visible to the operating
> system...

Does fBSD's file system creation make sure that all blocks of a newly
created file system are in fact usable? I would be surprised if there were
no cross checks in the formatting/partitioning/fs-creation path. If the
bad blocks weren't linked in the new filesystem, they would have become
invisible for practical purposes.

Bad side: This approach wipes the rest of your disk's contents.

Maybe there are some starting points in there.

 - John Mills



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.44.0301312140280.4225-100000>