# Seeking help for resuscitating an USB stick

## luismw

Hi there, I have this wonderful 32GB Kingston USB stick that has suddenly died on me. I was copying over some files and it seems that it unmounted itself (maybe I pulled it without noticing?) and when I tried plugging it again, it didn't work (I'm using the KDE Device Notifier to automount, btw).

What I would like to do, if possible, is to recover as much data as possible from the stick and then try to repair it and leave as good as new. The only problem is: I don't know how.

Here's all the data I have:

Dmesg during the failure: 

```
[194850.394107] hub 1-0:1.0: state 7 ports 8 chg 0000 evt 0004

[194850.394141] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001803 POWER sig=j CSC CONNECT

[194850.394168] hub 1-0:1.0: port 2, status 0501, change 0001, 480 Mb/s

[194850.498113] hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x501

[194850.549271] ehci_hcd 0000:00:1d.7: port 2 high speed

[194850.549294] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT

[194850.600097] usb 1-2: new high speed USB device using ehci_hcd and address 6

[194850.651523] ehci_hcd 0000:00:1d.7: port 2 high speed

[194850.651545] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT

[194850.715333] usb 1-2: default language 0x0409

[194850.716826] usb 1-2: udev 6, busnum 1, minor = 5

[194850.716840] usb 1-2: New USB device found, idVendor=0951, idProduct=1624

[194850.716852] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[194850.716864] usb 1-2: Product: DataTraveler G2

[194850.716873] usb 1-2: Manufacturer: Kingston

[194850.716883] usb 1-2: SerialNumber: 000AEBFFB402F9B1C5210CB0

[194850.717171] usb 1-2: usb_probe_device

[194850.717190] usb 1-2: configuration #1 chosen from 1 choice

[194850.717329] usb 1-2: adding 1-2:1.0 (config #1, interface 0)

[194850.717525] usb-storage 1-2:1.0: usb_probe_interface

[194850.717562] usb-storage 1-2:1.0: usb_probe_interface - got id

[194850.717881] scsi6 : usb-storage 1-2:1.0

[194850.718785] drivers/usb/core/inode.c: creating file '006'

[194851.718985] scsi 6:0:0:0: Direct-Access     Kingston DataTraveler G2  1.00 PQ: 0 ANSI: 2

[194851.719814] sd 6:0:0:0: Attached scsi generic sg2 type 0

[194851.725600] sd 6:0:0:0: [sdc] 62545024 512-byte logical blocks: (32.0 GB/29.8 GiB)

[194851.726212] sd 6:0:0:0: [sdc] Write Protect is off

[194851.726223] sd 6:0:0:0: [sdc] Mode Sense: 03 00 00 00

[194851.726230] sd 6:0:0:0: [sdc] Assuming drive cache: write through

[194851.736344] sd 6:0:0:0: [sdc] Assuming drive cache: write through

[194851.736358]  sdc: sdc1

[194851.748731] sd 6:0:0:0: [sdc] Assuming drive cache: write through

[194851.748744] sd 6:0:0:0: [sdc] Attached SCSI removable disk

[195383.048532] ehci_hcd 0000:00:1d.7: port 2 high speed

[195383.048548] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT

[195383.099112] usb 1-2: reset high speed USB device using ehci_hcd and address 6

[195383.150535] ehci_hcd 0000:00:1d.7: port 2 high speed

[195383.150551] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT

[195383.213339] usb 1-2: device firmware changed

[195383.213356] hub 1-0:1.0: logical disconnect on port 2

[195383.213412] hub 1-0:1.0: state 7 ports 8 chg 0004 evt 0000

[195383.213444] hub 1-0:1.0: port 2, status 0501, change 0000, 480 Mb/s

[195383.213461] usb 1-2: USB disconnect, address 6

[195383.213471] sd 6:0:0:0: Device offlined - not ready after error recovery

[195383.213486] usb 1-2: unregistering device

[195383.213499] usb 1-2: usb_disable_device nuking all URBs

[195383.213510] sd 6:0:0:0: [sdc] Unhandled error code

[195383.213520] sd 6:0:0:0: [sdc] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK

[195383.213539] sd 6:0:0:0: [sdc] CDB: Write(10): 2a 00 03 ad 70 d3 00 00 f0 00

[195383.213588] end_request: I/O error, dev sdc, sector 61698259

[195383.213688] sd 6:0:0:0: rejecting I/O to offline device

[195383.213715] sd 6:0:0:0: rejecting I/O to offline device

... Same error for about 140 lines ...

[195383.219619] sd 6:0:0:0: [sdc] Unhandled error code

[195383.219628] sd 6:0:0:0: [sdc] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

[195383.219637] sd 6:0:0:0: [sdc] CDB: Write(10): 2a 00 03 ad 71 c3 00 00 f0 00

[195383.219666] end_request: I/O error, dev sdc, sector 61698499

[195383.219780] usb 1-2: unregistering interface 1-2:1.0

```

I tried "fdisk /dev/sdc" and it answers "Unable to open /dev/sdc". I also tried "dosfsck /dev/sdc" and I get back "Got 0 bytes instead of 512 at 0". So my guess is that somehow the FAT got corrupted.

Any help would be greatly appreciated.

Thanks.

----------

## pianosaurus

 *luismw wrote:*   

> I also tried "dosfsck /dev/sdc" and I get back "Got 0 bytes instead of 512 at 0". So my guess is that somehow the FAT got corrupted.

 

Actually, it sounds like it is unable to read the table at all, not that it is corrupted. My guess is your data is lost.

I would try to disable any auto-mounting before inserting the stick, and running dd if=/dev/sdc of=somefile.img (replace sdc, of course). If that doesn't work, your drive is completely unreadable from user space. If it does work, you can mount the image using the loop device.

Addendum: Mounting with the loop device will require an offset, since the image will be of the entire disk and not just a partition. There are some tools to help in rebuilding partition tables, e.g. TestDisk.

----------

## i92guboj

It's going to be difficult to get anything out of that memory. The kernel is rejecting to even plug it, this is not an fs issue, there's a physical issue before you can even start thinking about mounting the fs.

Just for the remark, I've had many dying kingston data travelers on my own hands. I avoid them like the plague now.

----------

## luismw

Thanks for the information so far, I just wanted to clarify that when I plug the stick, it is still detected by the kernel, the only thing is that it can't be mounted. Here's what the kernel says when I plug the stick:

```

[195662.911935] hub 1-0:1.0: state 7 ports 8 chg 0000 evt 0004

[195662.911967] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001803 POWER sig=j CSC CONNECT

[195662.911995] hub 1-0:1.0: port 2, status 0501, change 0001, 480 Mb/s

[195663.016141] hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x501

[195663.067337] ehci_hcd 0000:00:1d.7: port 2 high speed

[195663.067360] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT

[195663.118109] usb 1-2: new high speed USB device using ehci_hcd and address 9

[195663.169335] ehci_hcd 0000:00:1d.7: port 2 high speed

[195663.169355] ehci_hcd 0000:00:1d.7: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT

[195663.233269] usb 1-2: default language 0x0409

[195663.234768] usb 1-2: udev 9, busnum 1, minor = 8

[195663.234781] usb 1-2: New USB device found, idVendor=0951, idProduct=1624

[195663.234794] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[195663.234805] usb 1-2: Product: DataTraveler G2

[195663.234815] usb 1-2: Manufacturer: Kingston

[195663.234824] usb 1-2: SerialNumber: 000AEBFFB402F9B1C5210CB0

[195663.235144] usb 1-2: usb_probe_device

[195663.235162] usb 1-2: configuration #1 chosen from 1 choice

[195663.235411] usb 1-2: adding 1-2:1.0 (config #1, interface 0)

[195663.235625] usb-storage 1-2:1.0: usb_probe_interface

[195663.235660] usb-storage 1-2:1.0: usb_probe_interface - got id

[195663.236103] scsi9 : usb-storage 1-2:1.0

[195663.237146] drivers/usb/core/inode.c: creating file '009'

[195664.237864] scsi 9:0:0:0: Direct-Access     GENERIC  USB Mass Storage 1.00 PQ: 0 ANSI: 2

[195664.238904] sd 9:0:0:0: Attached scsi generic sg2 type 0

[195664.259288] sd 9:0:0:0: [sdc] READ CAPACITY failed

[195664.259299] sd 9:0:0:0: [sdc] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE

[195664.259310] sd 9:0:0:0: [sdc] Sense Key : Unit Attention [current] 

[195664.259322] sd 9:0:0:0: [sdc] Add. Sense: Not ready to ready change, medium may have changed

[195664.260055] sd 9:0:0:0: [sdc] Write Protect is off

[195664.260067] sd 9:0:0:0: [sdc] Mode Sense: 03 00 00 00

[195664.260075] sd 9:0:0:0: [sdc] Assuming drive cache: write through

[195664.283537] sd 9:0:0:0: [sdc] READ CAPACITY failed

[195664.283548] sd 9:0:0:0: [sdc] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE

[195664.283559] sd 9:0:0:0: [sdc] Sense Key : Unit Attention [current] 

[195664.283571] sd 9:0:0:0: [sdc] Add. Sense: Not ready to ready change, medium may have changed

[195664.285343] sd 9:0:0:0: [sdc] Assuming drive cache: write through

[195664.285357] sd 9:0:0:0: [sdc] Attached SCSI removable disk
```

So at least that's something. I'll give a try to creating an image of the disk, although I'll have to think of something creative because the sitck has 32GB and my netbook has a 16GB SSD. I have an external USB disk, but it uses some funny FAT flavor and won't allow files larger than 4GB. Maybe I'll have to do it in my Mac, they have dd there too, don't they?

----------

## i92guboj

If you have a large FAT volume to store the files you can always use something like:

```
dd if=/dev/sda | gzip -c | split -b 2000m - /mnt/fat32/backup.img.gz
```

As long as dd is able to read anything at all.

----------

## luismw

Bad news (for me at least): dd is completely unable to read a thing there. I'm guessing that since fdisk as also unable to do a thing with the stick it's very likely that I won't be able to reformat it and get it working again. Luckily, I didn't have any really important data stored on the stick. Nevertheless, I'll try to stay away from Kingston the next time I buy a USB stick, this one hasn't lasted even six months of not too heavy use.

If anybody comes up with a some way to get the stick to work again, or a reasonably simple way to somehow recover the data, I'll appreciate it.

Thank you very much for your help so far.

----------

