[kwlug-disc] Checking a USB disk for errors

Khalid Baheyeldin kb at 2bits.com
Fri May 16 10:08:33 EDT 2014


On Thu, May 15, 2014 at 11:55 PM, William Park <opengeometry at yahoo.ca>wrote:

> On Thu, May 15, 2014 at 10:54:31PM -0400, Khalid Baheyeldin wrote:
> > On Thu, May 15, 2014 at 9:55 PM, Khalid Baheyeldin <kb at 2bits.com> wrote:
> > # time dd if=/dev/sdb bs=16000k of=/dev/null
> > 61047+1 records in
> > 61047+1 records out
> > 1000204886016 bytes (1.0 TB) copied, 28626.2 s, 34.9 MB/s
>
> 34.9MB/s is pretty fast for USB2, but slow for USB3.  What I usually do in
> this case is
>     badblocks -b 4096 -c 4096 -sv ...
>     badblocks -b 4096 -c 4096 -swv ...
> where -w is for destructive read/write test.
>

Thanks a lot. I will try that.

The other disk errored out early. It is identical in capacity, same OEM
vendor (LaCIE) and packaging with the fancy LED light, ..etc., but with a
Samsung disk inside:

# time dd if=/dev/sdb bs=16000k of=/dev/null
dd: reading `/dev/sdb': Input/output error
5533+1 records in
5533+1 records out
90667671552 bytes (91 GB) copied, 2661.36 s, 34.1 MB/s

real    44m21.367s
user    0m0.048s
sys     1m44.067s

So I did some math, and found that block 22135663 is bad.

So starting the read tests a bit before that:

# badblocks -b 4096 -c 4096 -sv /dev/sdb 23000000 22135600
Checking blocks 22135600 to 23000000
Checking for bad blocks (read-only test): 22135662done, 0:02 elapsed.
(0/0/0 errors)
22135663done, 0:04 elapsed. (1/0/0 errors)
done
Pass completed, *2 bad blocks found*. (2/0/0 errors)

But now after repeating the destructive test (-w) a few times, the error
disappeared?

# badblocks -b 4096 -c 4096 -svw /dev/sdb 23000000 22135600
Checking for bad blocks in read-write mode
>From block 22135600 to 23000000
Testing with pattern 0xaa:
done
Reading and comparing: done
Testing with pattern 0x55:
done
Reading and comparing: done
Testing with pattern 0xff:
done
Reading and comparing: done
Testing with pattern 0x00:
done
Reading and comparing: done
Pass completed, *0 bad blocks found*. (0/0/0 errors)

Did the drive reallocate the sector and hence it is no longer reporting
that one as defective?

Is it safe to use the drive, or it would be suspect? There is no click of
death or grinding sounds.
-- 
Khalid M. Baheyeldin
2bits.com, Inc.
Fast Reliable Drupal
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
For every complex problem, there is an answer that is clear, simple, and
wrong." -- H.L. Mencken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20140516/15da46e5/attachment.htm>


More information about the kwlug-disc mailing list