# usb stick and "no medium found"

## v_andal

Got weird problem. When I insert USB stick (16GB) I get messages

usb 2-1.8: new high speed USB device number 7 using ehci_hcd

scsi10 : usb-storage 2-1.8:1.0

scsi 10:0:0:0: Direct-Access     USB Mass Storage Device        PQ: 0 ANSI: 0 CCS

sd 10:0:0:0: Attached scsi generic sg3 type 0

sd 10:0:0:0: [sdc] Attached SCSI removable disk

But if I try to access this disk in any way, for example "fdisk /dev/sdc" then I get error 

fdisk: unable to open /dev/sdc: No medium found

At first I thought that the disk is bad, but I've plugged it into Debian computer and everything works there. It also works under Windows.

What could be the problem? Debian runs 2.6.32. Gentoo runs 2.6.39. I have another USB stick with 2GB and this one works everywhere.

----------

## b0nafide

Hmmm, searching the forums a bit my guess is: 

```
# grep CONFIG_BLK_DEV_UB /usr/src/linux/.config
```

(it shouldn't be set)

----------

## DooBeDooBeDo

I have a similar problem but only on one box

Bad box:

```
usb 2-4: new high speed USB device using ehci_hcd and address 2

usb 2-4: New USB device found, idVendor=14cd, idProduct=8123

usb 2-4: New USB device strings: Mfr=1, Product=3, SerialNumber=2

usb 2-4: Product: USB 2.0  SD MMC READER 

usb 2-4: Manufacturer: SDMMC MA8123

usb 2-4: SerialNumber: 812822222789

Initializing USB Mass Storage driver...

scsi8 : usb-storage 2-4:1.0

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

scsi 8:0:0:0: Direct-Access     USB 2.0  SD MMC Reader         PQ: 0 ANSI: 0 CCS

sd 8:0:0:0: Attached scsi generic sg3 type 0

sd 8:0:0:0: [sdc] Attached SCSI removable disk
```

Same kernel both machines, working machine is 64bit

```
uname -r

2.6.38-gentoo-r6
```

Good box:

```
usb 1-6: new high speed USB device using ehci_hcd and address 10

usb 1-6: New USB device found, idVendor=14cd, idProduct=8123

usb 1-6: New USB device strings: Mfr=1, Product=3, SerialNumber=2

usb 1-6: Product: USB 2.0  SD MMC READER 

usb 1-6: Manufacturer: SDMMC MA8123

usb 1-6: SerialNumber: 812822222789

scsi12 : usb-storage 1-6:1.0

scsi 12:0:0:0: Direct-Access     USB 2.0  SD MMC Reader         PQ: 0 ANSI: 0 CCS

sd 12:0:0:0: Attached scsi generic sg1 type 0

sd 12:0:0:0: [sdb] 15548416 512-byte logical blocks: (7.96 GB/7.41 GiB)

sd 12:0:0:0: [sdb] Write Protect is off

sd 12:0:0:0: [sdb] Mode Sense: 03 00 00 00

sd 12:0:0:0: [sdb] Assuming drive cache: write through

sd 12:0:0:0: [sdb] Assuming drive cache: write through

 sdb: sdb1

sd 12:0:0:0: [sdb] Assuming drive cache: write through

sd 12:0:0:0: [sdb] Attached SCSI removable disk
```

And on both machines:

```
grep CONFIG_BLK_DEV_UB /usr/src/linux/.config

# CONFIG_BLK_DEV_UB is not set
```

----------

## v_andal

It is also not set in my case. In fact, I've tried it yesterday on another Gentoo installation - same problem. I've even downgraded to 2.26.32 with no success. So, something else is missing in my gentoo installations   :Rolling Eyes: 

----------

## v_andal

I've tried to enable debugging message for USB storage driver. Got the following interesting part. See the highlighted line.

Aug 19 23:28:03 avlap kernel: usb-storage: Attempting to get CSW...

Aug 19 23:28:03 avlap kernel: usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes

Aug 19 23:28:03 avlap kernel: usb-storage: Status code 0; transferred 13/13

Aug 19 23:28:03 avlap kernel: usb-storage: -- transfer complete

Aug 19 23:28:03 avlap kernel: usb-storage: Bulk status result = 0

Aug 19 23:28:03 avlap kernel: usb-storage: Bulk Status S 0x53425355 T 0x2 R 0 Stat 0x1

Aug 19 23:28:03 avlap kernel: usb-storage: -- transport indicates command failure

Aug 19 23:28:03 avlap kernel: usb-storage: Issuing auto-REQUEST_SENSE

Aug 19 23:28:03 avlap kernel: usb-storage: Bulk Command S 0x43425355 T 0x3 L 18 F 128 Trg 0 LUN 0 CL 6

Aug 19 23:28:03 avlap kernel: usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes

Aug 19 23:28:03 avlap kernel: usb-storage: Status code 0; transferred 31/31

Aug 19 23:28:03 avlap kernel: usb-storage: -- transfer complete

Aug 19 23:28:03 avlap kernel: usb-storage: Bulk command transfer result=0

Aug 19 23:28:03 avlap kernel: usb-storage: usb_stor_bulk_transfer_sglist: xfer 18 bytes, 1 entries

Aug 19 23:28:03 avlap kernel: usb-storage: Status code 0; transferred 18/18

Aug 19 23:28:03 avlap kernel: usb-storage: -- transfer complete

Aug 19 23:28:03 avlap kernel: usb-storage: Bulk data transfer result 0x0

Aug 19 23:28:03 avlap kernel: usb-storage: Attempting to get CSW...

Aug 19 23:28:03 avlap kernel: usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes

Aug 19 23:28:03 avlap kernel: sd 2:0:0:0: Attached scsi generic sg2 type 0

For "working" USB stick this request is successful and after that the driver requests the size of the medium. Do they have some patch in the Debian version of the kernel that is not present in the Gentoo version?

----------

## v_andal

I keep searching, though it seems I should simply open a bug report.

I've found this thread http://www.mail-archive.com/linux-usb-users@lists.sourceforge.net/msg16821.html that talks about similar problem.

After reading it, I've also tried to attach USB stick before turning computer on. And it indeed worked fine. The messages corresponding to posted above looked like

 *Quote:*   

> 
> 
> Aug 21 18:56:40 avlap kernel: usb-storage: Attempting to get CSW...
> 
> Aug 21 18:56:40 avlap kernel: usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
> ...

 

What an interesting problem. What could be different at boot time? Is it actually udev problem?

----------

