A tool for remapping bad sectors in CURRENT?

Miroslav Lachman 000.fbsd at quip.cz
Sat Mar 13 20:45:16 UTC 2010


Dag-Erling Smørgrav wrote:
> Miroslav Lachman<000.fbsd at quip.cz>  writes:
>> Yes, rewriting by dd or any other way works for reallocating or
>> clearing pending sectors counter, but in server environment
>
> In a server environment, you'd be a fool not to have some sort of
> redundancy set up.

I am using gmirror on low-end servers, so rewriting some sectors on one 
disk drive is useless and in this case I prefer resync of the whole 
gmirror (but it is log run - about 10 hours on busy server)

>> I need to know the affected file, as it can be for example database
>> file and then it is a big problem! Rewriting the sector inside InnoDB
>> ib_data file can cause DB crash, data loss etc.
>
> How is that different from *not* rewriting the sector?  If there's a bad
> sector somewhere in your data, your database is still going to crash.

It is not about "different", it is about "I need to know the affected 
file" to know what actions should be taken.
If it is some logfile, I can delete it and then rewrite the sector. If 
it is some "normal" unchanged file, I can restore it from backup, if it 
is database file, I must take some special action. For example, stop DB 
engine, try to repair/fix the DB file, dump & restore etc.
So the first step is to find "what file is affected", then take some 
action AND rewrite the sector by dd to reallocate the sector. (or 
replace the drive)

So... can somebody with enough knowledge write some docs / script how to 
find the affected file based on LBA read error from messages / SMART log?

Miroslav Lachman


More information about the freebsd-current mailing list