4

I've got a usb stick which isn't recognized correctly by my system (Linux Mint 18, kernel version 4.4.0-34-generic). With lsusb the device is shown (it's the Kingston Technology DataTraveler G4):

Bus 002 Device 003: ID 062a:4102 Creative Labs 
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 04f2:b217 Chicony Electronics Co., Ltd Lenovo Integrated Camera (0.3MP)
Bus 001 Device 035: ID 0951:1666 Kingston Technology DataTraveler G4
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

But sudo fdisk -l doesn't show my device. This is why I can't get a UUID or something like /dev/sdb1, so I can't mount or format my thumb drive. Now I'm searching for ideas to make the thumb drive working properly again.

I plugged the thumb drive into a USB 2 port as I haven't got a USB 3 port. The thumb drive is connected directly with my laptop and it's the only device which is connected. I often tried disconnecting and reconnecting the thumb drive, but nothing happened.

Gparted doesn't recognize the usb stick. There is no driver related to "Kingston" in the driver manager.

This is the output of dmesg: http://pastebin.com/NR21FEWC

fdisk /dev/sg2 gives me this output:

Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

fdisk: cannot open /dev/sg2: No such file or directory

ls /dev/sd* gives me this output:

/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda4

lsblk shows:

NAME     MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda        8:0    0 465,8G  0 disk  
├─sda1     8:1    0     1G  0 part  /boot
├─sda2     8:2    0    20G  0 part  
│ └─root 252:0    0    20G  0 crypt /
├─sda3     8:3    0    10G  0 part  
│ └─swap 252:1    0    10G  0 crypt [SWAP]
└─sda4     8:4    0 434,8G  0 part  
  └─home 252:2    0 434,8G  0 crypt /home
sr0       11:0    1  1024M  0 rom 

/sbin/blkid shows:

/dev/mapper/root: UUID="007efd79-966b-43bd-a5c5-d67f5d987624" TYPE="ext4"
/dev/mapper/swap: UUID="b4960aab-6cbb-4c46-b74d-ee4fa56d01fd" TYPE="swap"
/dev/sda1: LABEL="BOOT" UUID="128f7dc5-1961-457b-90ca-421fc7eb481f" TYPE="ext2" PARTUUID="1138e37e-01"
/dev/sda2: UUID="d68911dd-172a-4608-86d4-084eb72f409c" TYPE="crypto_LUKS" PARTUUID="1138e37e-02"
/dev/sda3: UUID="4800307a-714c-4aca-b5d1-6b9ccf8b467c" TYPE="crypto_LUKS" PARTUUID="1138e37e-03"
/dev/sda4: UUID="db432f20-3889-44c2-8e67-7271634788be" TYPE="crypto_LUKS" PARTUUID="1138e37e-04"

tree /sys/bus/hid shows:

/sys/bus/hid
├── devices
│   └── 0003:062A:4102.0001 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/0003:062A:4102.0001
├── drivers
│   └── hid-generic
│       ├── 0003:062A:4102.0001 -> ../../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/0003:062A:4102.0001
│       ├── bind
│       ├── module -> ../../../../module/hid_generic
│       ├── new_id
│       ├── uevent
│       └── unbind
├── drivers_autoprobe
├── drivers_probe
└── uevent

6 directories, 7 files

This is the output of /sbin/udevadm monitor --property > thumbdrive.txt: http://pastebin.com/4SpYin45 or http://paste.debian.net/790206/

1 Answers1

1

Try creating a UDEV rule under /etc/udev/rules.d/

So create a rules file /etc/udev/rules.d/test.rules then add this in there:

ACTION=="add", ATTRS{idVendor}=="0951", ATTRS{idProduct}=="1666", SYMLINK+="Earls-Kingston-Thumbdrive"

Restart UDEV by running sudo /etc/init.d/udev restart

Remove and plug in the thumb drive and now you should have UDEV detect and create a symlink under /dev/Earls-Kingston-Thumbdrive

  • I tried this now. After plugging in the thumb drive, there is a symlink, but it's pointing only to an empty file named something like /dev/bsg/12:0:0:0 or /dev/bsg/15:0:0:0. This filename is changing every time I remove and reinsert the usb stick. – Earl Nick Aug 13 '16 at 19:27
  • Earl, please run lsmod | grep -i usb_storage in a terminal. if you see the usb_storage module is not loaded unplug the thumb drive then run sudo /sbin/modprobe usb_storage plug back the thumbdrive then re-check using fidsk -l – Aruna Hewapathirane Aug 14 '16 at 02:02
  • running lsmod | grep -i usb_storage gives me usb_storage 69632 1 uas. Does this mean that it's loaded or not? Btw: sometimes the symlink /dev/Earls-Kingston-Thumbdrive is also pointing to /dev/sg2 – Earl Nick Aug 14 '16 at 07:59
  • It means the usb_storage module IS loaded but no harm in running modprobe usb_storage to make sure any dependencies are loaded. Your dmesg last line [ 4961.591664] sd 9:0:0:0: Attached scsi generic sg2 type 0 tells us the thumb drive was attached as sg2 so /dev/sg2 is good. Does fdisk -l detect sg2 when this happens ? Since dmesg identifies the drive we can rule out any hardware defects but the firmware may be defective ? Plug your drive into a friends PC or laptop to see if the problem persists ? The MBR may also be damaged and can be replaced with dd but that is very last option. – Aruna Hewapathirane Aug 14 '16 at 13:50
  • No, fdisk -l does not detect sg2. I already plugged the drive into two different Windows 10 machines and into a Raspberry Pi running Raspbian, but none of the systems recognized the usb stick. – Earl Nick Aug 15 '16 at 07:52
  • Please run: /sbin/udevadm monitor --property and plug in thumbdrive lots of info will scroll by so best to run: /sbin/udevadm monitor --property > thumbdrive.txt then post this output so we can see how UDEV creates the device node in /dev as your thumbdrive is removed/attached. Run the command, redirect to file, plug in thumbdrive, wait a few seconds, remove thumbdrive, press ctl+c, browse the thumbdrive.txt and post it for us please. – Aruna Hewapathirane Aug 15 '16 at 13:50
  • pastebin says This page is no longer available. It has either expired, been removed by its creator, or removed by one of the Pastebin staff. Could you please re-post. – Aruna Hewapathirane Aug 17 '16 at 14:37
  • does this new link work now (the old one worked for me too...)? – Earl Nick Aug 17 '16 at 15:32
  • Which link ? You forgot to post it :) Use this http://paste.debian.net/ and set expiration to 'never'. – Aruna Hewapathirane Aug 18 '16 at 05:16
  • I meant the link at the end of my question. Now I also added the link to the Debian pastebin :) – Earl Nick Aug 18 '16 at 08:46
  • Sometimes a storage medium simply refuses to work at all. It still appears as a block device to the kernel and in the disk manager, but its first sector holding the partition table is not readable.

    This can be verified easily with: [Be very careful you have the "correct" device this can wipe everything]

    Try this first: sudo dd if=/dev/sg2 of=/dev/null count=1

    Then this: sudo dd if=/dev/sdb of=/dev/null count=1

    If this command results in a message about an “Input/output error”, our drive is broken or otherwise fails to interact with the Linux kernel as expected.

    – Aruna Hewapathirane Aug 18 '16 at 21:11
  • Reference: [http://askubuntu.com/questions/539184/how-do-i-check-the-integrity-of-a-storage-medium-hard-disk-or-flash-drive] – Aruna Hewapathirane Aug 18 '16 at 21:12
  • The command sudo dd if=/dev/sdb of=/dev/null results in dd: failed to open '/dev/sdb': No such file or directory. The command sudo dd if=/dev/sg2 of=/dev/null count=1 doesn't copy anything. After about 80 seconds, it just said dd: error reading '/dev/sg2': No such device 0+0 records in 0+0 records out 0 bytes copied, 79,4916 s, 0,0 kB/s There was also no /dev/sg2 anymore, after those 80 seconds, but before starting dd, \dev\sg2 was there. – Earl Nick Aug 19 '16 at 10:13
  • I am sorry Earl look's like your thumb-drive is kaput :-( if you still want to try this may help http://www.adata.com/en/ss/usbdiy/ this requires Windows XP SP3 or later (login with Administrator rights) – Aruna Hewapathirane Aug 19 '16 at 14:22