LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-22-2009, 09:58 PM   #1
dh4
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Rep: Reputation: 0
USB Flash Drive Problem - possibly corrupt??


I have been having problems mounting my USB flash drive and I think it may be corrupt. If it is corrupt, can anyone suggest some possibilities for recovering. I have been trying to use fdisk and fsck to figure out what's going on. What I have found out is below.

When I plug in my USB flash drive with

Code:
tail -f /var/log/messages
running I get the following output:

Code:
Dec 22 22:00:41 localhost kernel: usb 1-3: new high speed USB device using ehci_hcd and address 57
Dec 22 22:00:41 localhost kernel: usb 1-3: configuration #1 chosen from 1 choice
Dec 22 22:00:41 localhost kernel: scsi17 : SCSI emulation for USB Mass Storage devices
Dec 22 22:00:46 localhost kernel: scsi 17:0:0:0: Direct-Access     Generic  STORAGE DEVICE   9407 PQ: 0 ANSI: 0
Dec 22 22:01:16 localhost kernel: usb 1-3: reset high speed USB device using ehci_hcd and address 57
Dec 22 22:01:43 localhost kernel:last message repeated 4 times
Dec 22 22:01:43 localhost kernel: sd 17:0:0:0: scsi: Device offlined - not ready after error recovery
Dec 22 22:01:43 localhost kernel: sd 17:0:0:0: rejecting I/O to offline device
Dec 22 22:01:43 localhost kernel:last message repeated 2 times
Dec 22 22:01:43 localhost kernel: sd 17:0:0:0: [sdb] READ CAPACITY failed
Dec 22 22:01:43 localhost kernel: sd 17:0:0:0: [sdb] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK,SUGGEST_OK
Dec 22 22:01:43 localhost kernel: sd 17:0:0:0: [sdb] Sense not available.
Dec 22 22:01:43 localhost kernel: sd 17:0:0:0: rejecting I/O to offline device
Dec 22 22:01:43 localhost kernel: sd 17:0:0:0: [sdb] Write Protect is off
Dec 22 22:01:43 localhost kernel: sd 17:0:0:0: [sdb] Assuming drive cache: write through
Dec 22 22:01:43 localhost kernel: sd 17:0:0:0: [sdb] Attached SCSI removable disk
Dec 22 22:01:43 localhost kernel: sd 17:0:0:0: Attached scsi generic sg2 type 0
I'm not crazy about a couple of the messages I see there "READ CAPACITY failed" and "Device offlines - not ready after error recovery". But I can see the device is there via lsusb and that it is at /dev/sdb from using lsscsi:

Code:
> /sbin/lsusb
Bus 001 Device 057: ID 0781:b2b5 SanDisk Corp.
> /sbin/lsscsi
[17:0:0:0]  disk  Generic  STORAGE DEVICE  9407  /dev/sdb
so it "looks" like it's at /dev/sdb (where my USB flash drives usually show up). So if I try to mount it as usual it doesn't work:

Code:
> mount -t vfat /dev/sdb1 /mnt/flash
mount: special device /dev/sdb1 does not exist
So, I try to see the partitions on the disk using fdisk but that fails and even fsck can't seem to open it:

Code:
> /sbin/fdisk -l /dev/sdb
(no output, just a blank line)

> /sbin/fdisk /dev/sdb
Unable to open /dev/sdb

> /sbin/fsck.msdos /dev/sdb
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
open /dev/sdb:No such device or address
Does anyone have any suggestions?

Last edited by dh4; 12-23-2009 at 03:36 PM.
 
Old 12-23-2009, 01:39 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
'Device offlined' would suggest it's a dodgy connection, more than anything. There's no fsck done while mounting, if it figures it out it goes online. The usual error there is 'rejecting i/o to dead device' Perhaps use an extension cable or put something under it to take it's weight. Squeeze the plug closed a little if it's spread out.

fdisk needs root to do anything. 'mount /dev/sdb /somewhere' might just do it. It doesn't seem partitioned.
 
Old 12-23-2009, 03:37 PM   #3
dh4
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I tried doing a 'mount /dev/sdb /mnt/flash' assuming that there was no partition table (I have an mp3 player like that) but that didn't do anything either. I'm assuming that the drive is corrupted because when I plug the drive into a WinXP box it brings it to it's knees and freezes up everything (reboot required). So it seems that something is "bad" with that drive. I have actually recovered a corrupted flash drive before using a procedure similar to this but even this didn't work because the command 'dd if=/dev/sdb of=/tmp/r1 bs=512' threw an error saying that /dev/sdb couldn't be found.
 
Old 12-24-2009, 04:40 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Is there a /mnt/flash directory? try
mnt /dev/sdb /mnt/tmp - that should exist in slackware.
You're right, the drive sounds knackered. But the real killer here is overcurrent errors in the logs. Then that usb port gets switched off, and it's time to reach for the bin. I spent a long time doing hardware repairs. There were two basic rules Both broken surprisingly often)
1. If it works, don't fix it!
2. If it's not worth it, don't fix it!

Flash drives are cheap. Rule no. 2 may apply.
 
Old 12-25-2009, 09:51 AM   #5
dh4
LQ Newbie
 
Registered: Mar 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Yup, I agree. Flash drives are cheap. Unless they contain photos of your newborn daughter ... then it's not really the price of the drive that matters.

I'm a Linux sys admin so all the noob questions are covered (did stuff as root and mount dir exists, etc).

Thanks for the suggestions. I figured the drive was toast but thought I would put it out there.
 
  


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
Corrupt files on USB flash drive won't delete!! Indy452 Linux - General 13 04-29-2010 08:03 AM
Flash Drive Will Not Mount - May Be Corrupt ChristianSean Linux - Newbie 4 12-13-2009 12:00 PM
usb flash drive problem soumalya Linux - Desktop 3 06-01-2008 05:23 AM
USB flash drive problem Executor21 SUSE / openSUSE 4 12-17-2006 12:45 PM
Usb flash drive problem procfs Linux - Hardware 5 07-18-2006 10:51 PM

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

All times are GMT -5. The time now is 12:44 AM.

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