USB drive horked?

Asked by Ben P.

This morning, a slow screen refresh while I was switching desktops and getting dressed for work at the same time made me think that my flash drive was already unmounted. It wasn't -- the icon for it was just slow to re-draw, which of course I did not notice until I had already yanked the thing out of the hub, and the icon flickered to life for a split second before disappearing.

That sound you heard as I described it? It was the sound of the last two weeks of work since I last backed up this flash drive screaming into oblivion, apparently.

Now, when I plug the device is, dmesg recognizes that a USB device has been placed into the slot, but utterly fails to do anything from there. Here's the snippet of my dmesg file from when I rebooted with three usb flash devices plugged in -- note that the one labeled USB MEMORY BAR, whcih it apparently recognizes as [sdb] is the victim of my failed adventure in multitasking this morning, while the other two devices are a USB flash memory card reader and a second actual flash drive, respectively. As you can see, there is a real difference in the amount of dmesg information between the two drives which are recognized, and the third drive which is not.

[ 40.577616] usb-storage: device scan complete
[ 40.580609] scsi 2:0:0:0: Direct-Access USB MEMORY BAR 1000 PQ: 0 ANSI: 0 CCS
[ 40.593646] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ 40.593699] sd 2:0:0:0: Attached scsi generic sg2 type 0
[ 40.605548] usb-storage: device scan complete
[ 40.608584] scsi 3:0:0:0: Direct-Access Multi Flash Reader 1.00 PQ: 0 ANSI: 0
[ 40.629608] usb-storage: device scan complete
[ 40.632540] scsi 4:0:0:0: Direct-Access SEAGATE ST660211USB 4.06 PQ: 0 ANSI: 2
[ 41.133885] sd 3:0:0:0: [sdc] 3970048 512-byte hardware sectors (2033 MB)
[ 41.138872] sd 3:0:0:0: [sdc] Write Protect is off
[ 41.138875] sd 3:0:0:0: [sdc] Mode Sense: 03 00 00 00
[ 41.138878] sd 3:0:0:0: [sdc] Assuming drive cache: write through
[ 41.150860] sd 3:0:0:0: [sdc] 3970048 512-byte hardware sectors (2033 MB)
[ 41.155851] sd 3:0:0:0: [sdc] Write Protect is off
[ 41.155854] sd 3:0:0:0: [sdc] Mode Sense: 03 00 00 00
[ 41.155857] sd 3:0:0:0: [sdc] Assuming drive cache: write through
[ 41.155861] sdc: sdc1
[ 41.161930] sd 3:0:0:0: [sdc] Attached SCSI removable disk
[ 41.161997] sd 3:0:0:0: Attached scsi generic sg3 type 0
[ 41.167879] sd 4:0:0:0: [sdd] 11719008 512-byte hardware sectors (6000 MB)
[ 41.172857] sd 4:0:0:0: [sdd] Write Protect is off
[ 41.172863] sd 4:0:0:0: [sdd] Mode Sense: 73 00 00 08
[ 41.172866] sd 4:0:0:0: [sdd] Assuming drive cache: write through
[ 41.184818] sd 4:0:0:0: [sdd] 11719008 512-byte hardware sectors (6000 MB)
[ 41.189828] sd 4:0:0:0: [sdd] Write Protect is off
[ 41.189833] sd 4:0:0:0: [sdd] Mode Sense: 73 00 00 08
[ 41.189836] sd 4:0:0:0: [sdd] Assuming drive cache: write through
[ 41.189843] sdd: sdd1
[ 42.442394] sd 4:0:0:0: [sdd] Attached SCSI removable disk
[ 42.442449] sd 4:0:0:0: Attached scsi generic sg4 type 0

Any help here would be very much appreciated. I note for the record that I've tried Gparted, and it did not even see the device -- it detects the computer's hard drive, and the two other flash devices, but not my poor little 1GB work drive.

Any suggestions? Please do not be bashful. After two hours of trying to troubleshoot this on my own with various reboots (in the hopes that the device would auto-detect and auto-fsck), forced attempts to fsck (which yielded the information that /dev/sdb ain't valid no way, no how), and lots of Googling for alternate ideas (including the use of Gparted), I'm all out of ideas, myself.

-Ben P.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Wyatt Smith (wyatt-smith) said :
#1

Please open a terminal and type

sudo fdisk -lu

Please tell... the output of that command

Thanks

Revision history for this message
Ben P. (andorian) said :
#2

Output copied below. The hard drive and the the two other flash devices show, but that's it.

Disk /dev/sda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders, total 78140160 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x000673a3

   Device Boot Start End Blocks Id System
/dev/sda1 * 63 75119939 37559938+ 83 Linux
/dev/sda2 75119940 78140159 1510110 5 Extended
/dev/sda5 75120003 78140159 1510078+ 82 Linux swap / Solaris

Disk /dev/sdc: 2032 MB, 2032664576 bytes
64 heads, 63 sectors/track, 984 cylinders, total 3970048 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x97039d75

   Device Boot Start End Blocks Id System
/dev/sdc1 249 3967487 1983619+ 6 FAT16

Disk /dev/sdd: 6000 MB, 6000132096 bytes
121 heads, 63 sectors/track, 1537 cylinders, total 11719008 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x692365c6

   Device Boot Start End Blocks Id System
/dev/sdd1 * 63 11719007 5859472+ c W95 FAT32 (LBA)

Revision history for this message
apinunt (apinunt) said :
#3

I encounter a problem copying large files to a USB device and get an error message that the drive was disconnected unsafely, after which I can not mount the drive again.
In my case I can see the external drive and its partition still show existing as /dev/sdb /dev/sdb1, and find that I can manually mount the drive and access its content, but have to use umount to unmount it when done as no icon appears when doing this.

This may not be a recommended practice, but the way I've done this is from a terminal type the following:

cd /
sudo mkdir xxx
sudo mount -t ntfs-3g /dev/sdb1 /xxx -o force

I can then access my files by

cd xxx
ls

do whatever I wish with the files, and unmount the drive with

sudo umount /dev/sdb1

Note that I am using an external 500GB drive formatted ntfs, and in your case I assume you would have to change the command to mount your device with fat.

Also I have found that by leaving the external drive mounted and shutting down the system, I can then remove the drive and reboot and then insert the drive and the system recognizes and mounts it automatically. This might be worth trying first as I'm not sure if my other method is a recommended procedure.

Revision history for this message
Ben P. (andorian) said :
#4

Issuing the sudo mount command as noted (in this case, as 'sudo mount -t vfat /dev/sdb1 /rescueme -o force') gives me the response:
mount: /dev/sdb1 is not a block device (maybe try `-o loop'?)

I note that the device seems to be known only as /dev/sdb, and when I try that instead of /dev/sdb1 in the same command, of course, I get a 'no medium found' error.

This is what's maddening. Because dmesg makes it clear that the darn thing is being properly recognized and identified *as* an external USB drive, but then nothing after that which makes it act like a USB drive actually takes place. Simply unplugging and reinserting the thing adds this to dmesg:

[43853.719065] usb 1-2.1: new full speed USB device using uhci_hcd and address 20
[43853.824033] usb 1-2.1: not running at top speed; connect to a high speed hub
[43853.853280] usb 1-2.1: configuration #1 chosen from 1 choice
[43853.858215] scsi11 : SCSI emulation for USB Mass Storage devices
[43853.859565] usb-storage: device found at 20
[43853.859573] usb-storage: waiting for device to settle before scanning
[43861.183306] usb-storage: device scan complete
[43861.186322] scsi 11:0:0:0: Direct-Access USB MEMORY BAR 1000 PQ: 0 ANSI: 0 CCS
[43861.202397] sd 11:0:0:0: [sdb] Attached SCSI removable disk
[43861.202494] sd 11:0:0:0: Attached scsi generic sg2 type 0

And unless I miss my guess, for any reference to /dev/sdb1 to be valid, there's a bunch more stuff that should be there after 43861.186322 but before 43861.202397.

Revision history for this message
apinunt (apinunt) said :
#5

I'm not an expert in this area, but what I have to do is look at /dev and I usually find an entry of either sda and an sda1 or sdb and an sdb1 which relates to the usb drive which won't mount automatically. If I understand correctly, the sda or sdb entry in /dev is the entire drive, and the numbered entry sda1 or sdb1 relates to the partition on the drive which is to be mounted. If you only have an sda or an sdb entry without a number included, I don't believe you have anything which can be mounted.
Another location to check is /media and if you have no USB devices mounted you should find a file named .hal-mtab which should contain 0 bytes. If it has any content it can be deleted as it is recreated when a usb device is plugged in. Also you might find some entries there which are the same as the label that is contained on the usb device that was last mounted that can also be deleted. Usually a system reboot clears any of these entries in /media.
I assume the device you are trying to mount is vfat? Also /dev would have to display a lingering sda1 or sdb1 entry associated with the device when it was last mounted in order to be able to mount the partition it contains.
I think you can use mount with an auto option which tries to determine the mount type, but I've never tried that.
I have a speed problem if I use my computers front usb ports and have to use the rear ports to get usb2 support.
My dmesg shows the below when plugging in a memory stick:
[ 2662.526989] usb 4-5: new high speed USB device using ehci_hcd and address 2
[ 2662.674487] usb 4-5: configuration #1 chosen from 1 choice
[ 2663.155748] usbcore: registered new interface driver libusual
[ 2663.232245] Initializing USB Mass Storage driver...
[ 2663.233624] scsi0 : SCSI emulation for USB Mass Storage devices
[ 2663.234952] usbcore: registered new interface driver usb-storage
[ 2663.234965] USB Mass Storage support registered.
[ 2663.235836] usb-storage: device found at 2
[ 2663.235840] usb-storage: waiting for device to settle before scanning
[ 2668.235666] usb-storage: device scan complete
[ 2668.266041] scsi 0:0:0:0: Direct-Access Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 0 CCS
[ 2668.536087] SCSI device sda: 7823360 512-byte hdwr sectors (4006 MB)
[ 2668.536830] sda: Write Protect is off
[ 2668.536834] sda: Mode Sense: 23 00 00 00
[ 2668.536838] sda: assuming drive cache: write through
[ 2668.540334] SCSI device sda: 7823360 512-byte hdwr sectors (4006 MB)
[ 2668.541076] sda: Write Protect is off
[ 2668.541080] sda: Mode Sense: 23 00 00 00
[ 2668.541083] sda: assuming drive cache: write through
[ 2668.541262] sda: sda1
[ 2668.583533] sd 0:0:0:0: Attached scsi removable disk sda
[ 2668.606811] sd 0:0:0:0: Attached scsi generic sg0 type 0
And /dev/sda and /dev/sda1 are now present.
In /media I see a folder named KINGSTONC, which is the label given the memory stick when it was formatted. I can open that folder and access the drives content.
And I also have the following content in .hal-mtab:
/dev/sda1 1000 0 vfat noexec,nosuid,nodev,shortname=mixed,uid=1000,utf8,umask=077,exec /media/KINGSTONC
I don't know if any of this is helpful or not, but if there's anything else I can look at that might help let me know.

Revision history for this message
apinunt (apinunt) said :
#6

NOTE:
Looking at the man page on mount, it may not be advisable to use the auto option as it presents a warning:
 The auto type may be useful for user-mounted floppies. Creating a file /etc/filesystems can be useful to change
the probe order (e.g., to try vfat before msdos or ext3 before ext2) or if you use a kernel module autoloader.

Warning: the probing uses a heuristic (the presence of appropriate ‘magic’), and could recognize the wrong
filesystem type, possibly with catastrophic consequences. If your data is valuable, don’t ask mount to guess.

BTW:
lsusb shows this:
~$ lsusb
Bus 004 Device 002: ID 0930:6545 Toshiba Corp.
Bus 004 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

Can you help with this problem?

Provide an answer of your own, or ask Ben P. for more information if necessary.

To post a message you must log in.