On Sun, Aug 18, 2013 at 01:00:07PM +0100, Mik J wrote:
> First I would like to understand
> better what's happening. According to what I read, there are no block in the
> disk itself, they refer to the word sector. Then, the OS, here OpenBSD format
> it with a block size.
> So from a physical point of view I have faulty sectors
> on my disk right ?

My apologies for the confusion.  On the drive hardware, one may consider 
"sector", "block", and "LBA" (Logical Block Address) as equivalent terms for
the same thing -- an addressable storage location on the hard drive.  This is
different than filesystem data units -- in FFS, clusters and fragments --  
which contain multiple sectors, and therefore you may be confusing with 
"block".

> I bought this disk about a year ago. And ok, I write in a
> few files (~1000 rrd files) every minute all year long. I'm surprise that you
> guys ask me to throw the disk away because a few blocks out of thousands are
> faulty.
> 
> Smartmontools doesn't complain about my disk
> 
> # smartctl -H /dev/wd1c
> === START OF READ SMART DATA SECTION ===
> SMART overall-health self-assessment
> test result: PASSED
> 
> # smartctl -l selftest? /dev/wd1c
> === START OF READ SMART
> DATA SECTION ===
> SMART Self-test log structure revision number 1
> Num?
> Test_Description??? Status????????????????? Remaining? LifeTime(hours)?
> LBA_of_first_error
> # 1? Short offline?????? Interrupted (host reset)?????
> 90%???? 25468???????? -
 
The short offline test is a test of drive electronics and mechanics, but does
not test media.  And your short offline test did not complete successfully, 
the test was stopped prior to completion. A long offline test is a read test 
of media.   Both tests are done by the drive electronics.

> Josh do you know which program I should use in
> sleuthkit suite ?
> I'm very interested in knowing which files I've lost
 
Unfortunately, it's been too long, and there are many sleuthkit utilities.  
You might consider running sleuthkit.org's Autopsy webserver, which 
automates the toolset.  I've used it once or twice, and I would recommend
it to occasional sleuthkit users.  
 
> And
> do you know which badblocks option I should use to follow your suggestion ?
> At the end I will follow your recomendations and buy a new disk for my data.
> But I'll keep this one for a test server and of course I'll put a red sticker
> on the disk and write "faulty disk"

Bad sectors (bad blocks, bad LBAs) can occur for a wide variety of reasons.
The risk to continued use of the drive is only that your particular reason 
cannot be determined with assurance.

Drive electronics will automatically replace bad sectors from a built-in
set of spares.  To to that, the drive has to note that the sector is bad,
(the drive's electronics may report this to smartmontools as non-zero pinned 
sectors) and then have a new write occur to the bad sector.  

The badblocks -w option writes and reads a variety of data patterns to each 
sector on the drive (or to a subset of the drive) and this activity can "clear" 
bad blocks by causing the drive to substitute spare sector(s) for bad ones, 
using the same Logical Block Address (LBA) as the unusable sectors.

There is a badblocks -n option which conducts a "non-destructive" write test,
which I have not used but I assume restores the contents after the pattern
has been written and read.

Reply via email to