Subject: Re: WD_SOFTBADSECT & WD_QUIRK_FORCE_LBA48 usage (a few more questions)
To: None <>
From: None <>
List: tech-kern
Date: 10/06/2005 21:00:16
Thanks Manuel -- one more question concerning WD_SOFTBADSECT & your 

>A bad sector will be remapped on write. But if it's in the bad block 
>the driver will return an I/O error on write without sending the
>command to the disk. So bad sectors will never be remapped once they've
>been recorded in the kernel bad sector list.

When does the driver add a block to its bad sector list?
Is it anytime there's a read *or* write error after X many retries?

Also, we're currently using a fairly 'old' wd.c driver & 1.6 NetBSD 
kernel; Nov 1, 2002 to be exact.
How difficult would it be to pickup the WD_SOFTBADSECT specific changes,
especially if there are several dependent files for the 

>> How would I remap a bad
>> sector when using WD_SOFTBADSECT?

>First flush the bad sector list with atactl, then do a write to this

On a running system, the bad sector list will grow over time (assuming 
there are bad blocks).
Is it *safe* to run atactl at any time, or does one have to 
shutdown/reboot the system first?
I guess this would imply that the bad sector list is persistent.

How can I (the application) do a write to the bad sector?
Can I obtain the bad sector list from the driver?
Is this all made transparent by the file-system?

thanks Manuel for your help again,

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference