LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-04-2006, 02:13 AM   #1
LinuxGeek
Member
 
Registered: Jun 2002
Posts: 302

Rep: Reputation: 31
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
 
Old 01-04-2006, 07:20 AM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
I do not know what's wrong there, but since you are asking for ideas...
Looks like you have a transmission problem. I mean physical. Similar errors occur when data cables/connectors are bad. Random read and write errors. Do you connect it directly to USB port? Is it all same if you use another port? Another computer? (Regenerator probably tried multiple times and carried on until it got positive answer for every block - 3+ hours...)
 
Old 01-04-2006, 08:04 AM   #3
LinuxGeek
Member
 
Registered: Jun 2002
Posts: 302

Original Poster
Rep: Reputation: 31
Thanks for your reply. It might be a transmission error because it's not directly connected to the USB port. I'll try to test it out on another port. I think that Regenerator took a long time since it seems to be using a v1.1 USB driver and the USB Flash drive is kind of big (1GB). Also, I think if there were any errors, Regenerator would have pointed it out and then indicated that it had 'fixed' them since that would indicate that Regenerator works . Just out of curiosity, from your experience, is badblocks reliable? Also, could it be issue between the SCSI driver and the USB storage driver for example? Thanks for your time.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RPMs are driving me insane gauge73 Linux - Newbie 11 05-05-2005 01:02 PM
Samba driving me insane Lorend Linux - Newbie 7 02-16-2005 06:26 PM
Mplayer Driving Me Insane!!!!! njschroe Linux - Software 7 01-24-2005 05:31 PM
cvswinex driving me insane araldit Linux - Newbie 0 07-02-2004 05:05 PM
Sendmail is driving me insane. Please help me. ecroskey Linux - Newbie 1 03-02-2003 06:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration