On Mon, Oct 13, 2003 at 07:24:00PM +0900, Norman Diamond wrote:Can't you pretty much get the drive to check itself using smartctl, such as running:
John Bradford replied to me:
I agree, we are not sure if a read will do that. That is the reason why twoHow can I tell Linux to read every sector in the partition? Oh, I mightA read won't necessarily do that. You might have to write to a
know this one,
dd if=/dev/hda8 of=/dev/null
I want to make sure that the drive is now using a non-defective
replacement sector.
defective sector to force re-allocation.
of my preceding questions were:
I've seen a disk (which now failed and will be replaced 3 hours from now)
remap defective sectors without reporting any errors to the OS. The SMART "remapped sector count" just went up, but no errors in the
logs. So apparently, the disk noticed something and remapped teh sector
without anybody noticing.
I think he's using reiserfs on the partition, which ASFAIK doesn't support marking bad sectors without some work. I tend to agree with namesys when they suggest just getting a new drive if it has used up all of its extra sectors. In my experience (admittedly limited), any drive which runs out of extra sectors starts to go bad in a hurry.
How can I find out which file contains the bad sector? I would like to
try to recreate the file from a source of good data.
Try: tar cf - / | dd of=/dev/null
(note some people will try to abbreviate that to tar cf /dev/null / but that won't work: Tar will recognise that it's writing to /dev/null
and skip reading the files! That's a bug in tar in my book. )
How can I tell Linux to mark the sector as bad, knowing the LBA sector
number?
man tune2fs .
You have to do the math on the LBA sector numbers (subtract the
partition start, divide by two).
Also, you can use the "badblocks" program.
Roger.