Member
Registered: Jun 2002
Posts: 302
Rep:
|
USB/SCSI Errors Driving Me Insane
Hi,
I just experienced something very strange with the USB / SCSI support under Linux. I have a 1GB USB stick and when I connect it, it always detects that there is a device on the USB (/dev/sda) but sometimes I keep getting strange errors in dmesg such as:
sda: Current: sense key: Medium Error
or
Additional sense: Unrecovered read error - recommend rewrite the data
and other strange messages. Sometimes it would see the partition table and everything would mount and read/write data without errors and at other times, it would give me errors and sometimes complain of a corrupt partition table.
sda: assuming drive cache: write through
sda:<3>scsi8 (0:0): rejecting I/O to dead device
Buffer I/O error on device sda, logical block 0
scsi8 (0:0): rejecting I/O to dead device
Buffer I/O error on device sda, logical block 0
scsi8 (0:0): rejecting I/O to dead device
Buffer I/O error on device sda, logical block 0
unable to read partition table
scsi8 (0:0): rejecting I/O to dead device
When it does work, everything is fine and here's the output from lsusb:
Bus 002 Device 006: ID 0457:0150 Silicon Integrated Systems Corp. Super Talent 1GB Flash Drive
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
When it didn't detect a partition table, I decided to run badblocks on it and used the following options for a non-destructive read-write test:
badblocks -vv -b 4096 -c 1000 /dev/sda -n
Badblocks would give me all sorts of results. The first time I ran it, it told me that there were 9 bad blocks. I then ran it again, it told me 34 or 35 bad blocks. The 3rd time, it told me only 2 bad blocks. The 4th and 5th time that I ran it, it told me 0 bad blocks
From this experience, I'm starting to doubt the feedback that badblocks provides although I know of no other alternative to it under Linux.
In the times that it does detect a partition table and I want to run fsck on my ext3 partition, it quickly runs and tells me everything is fine. But after a few times of it telling me no partition table, and other errors, I decided to run fsck.ext3 with checking for bad blocks so that my data doesn't get corrupted. So I ran the following command:
fsck.ext3 -cc /dev/sda2 -k
Here's part of the output (this is less than 1% of the output that it gave me):
Inode 83893 has compression flag set on filesystem without compression support. Clear<y>? yes
Inode 83893 has INDEX_FL flag set but is not a directory.
Clear HTree index<y>? yes
Inode 83893, i_size is 14729451953366660254, should be 0. Fix<y>? yes
Inode 83893, i_blocks is 3615685306, should be 0. Fix<y>? yes
Inode 84023 has compression flag set on filesystem without compression support. Clear<y>? yes
Inode 84023 has INDEX_FL flag set but is not a directory.
Clear HTree index<y>? yes
Inode 84023, i_size is 293579445118807436, should be 0. Fix<y>? yes
Inode 84023, i_blocks is 3826961336, should be 0. Fix<y>? yes
Inode 83948 has compression flag set on filesystem without compression support. Clear<y>? yes
Inode 83948, i_size is 9560822613988399722, should be 0. Fix<y>? yes
Inode 83948, i_blocks is 3467230678, should be 0. Fix<y>? yes
Inode 84006 has INDEX_FL flag set but is not a directory.
Clear HTree index<y>? yes
Inode 84006, i_size is 11623539368098576970, should be 0. Fix<y>? yes
Inode 84006, i_blocks is 2982666266, should be 0. Fix<y>? yes
Inode 83962 has compression flag set on filesystem without compression support. Clear<y>? yes
Inode 83962 has INDEX_FL flag set but is not a directory.
Clear HTree index<y>? yes
Inode 83962, i_size is 4697271177445543105, should be 0. Fix<y>? yes
Inode 83962, i_blocks is 4190730955, should be 0. Fix<y>? yes
Inode 84008, i_size is 10341245272804813389, should be 0. Fix<y>? yes
Inode 84008, i_blocks is 4235851787, should be 0. Fix<y>? yes
Inode 83939, i_size is 12682404770961892632, should be 0. Fix<y>? yes
Inode 83939, i_blocks is 3673026079, should be 0. Fix<y>? yes
Inode 83980 has compression flag set on filesystem without compression support. Clear<y>? yes
Inode 83980 has illegal block(s). Clear<y>? yes
Illegal block #0 (4092717027) in inode 83980. CLEARED.
Illegal block #1 (7993355) in inode 83980. CLEARED.
Illegal block #2 (4092602200) in inode 83980. CLEARED.
Illegal block #3 (3349119018) in inode 83980. CLEARED.
Illegal block #4 (2676133839) in inode 83980. CLEARED.
Illegal block #5 (2046301343) in inode 83980. CLEARED.
Illegal block #6 (226492416) in inode 83980. CLEARED.
Illegal block #7 (1612611072) in inode 83980. CLEARED.
Illegal block #8 (4058505346) in inode 83980. CLEARED.
Illegal block #9 (100268275) in inode 83980. CLEARED.
Illegal block #10 (2885696764) in inode 83980. CLEARED.
Too many illegal blocks in inode 83980.
Clear inode<y>? yes
Inode 83996 has compression flag set on filesystem without compression support. Clear<y>? yes
Inode 83996, i_size is 18075812300456300326, should be 0. Fix<y>?
In the end, from all it's corrections to the file system, the ext file system became corrupted. It basically killed my file system (good thing I had backups of the data on it).
Frustrated, I decided to try out a commercial solution and got HDD Regenerator v1.51. I rebooted and got it to scan my USB. It was very slow and took over 3 hours, but it in the end, it found 0 bad blocks. This leads me to the conclusion that it's either a USB storage issue or a scsi issue. Any ideas? Thanks for your help.
PS. I'm currently using Suse v10 with kernel 2.6.13-5
|