# USB 2.0 memory stick doesn't create /dev/sda1 [solved]

## cfgauss

When I upgraded from gentoo-sources-2.6.11 to gentoo-sources-2.6.12, I got my USB 2.0 memory stick to work for the first time. Now I'm at gentoo-sources-2.6.12-r7 and udev 065 and it now doesn't work (and hasn't for the last few kernels).

Both ehci and ohci are compiled into the kernel. When I remove ehci from the kernel, ohci takes over and my memory stick connects at USB 1.1 speeds. When both are in the kernel, here's my dmesg:

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

usb 1-5: can't set config #1, error -110

usb 1-5: new high speed USB device using ehci_hcd and address 3

scsi0 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 3

usb-storage: waiting for device to settle before scanning

  Vendor: SanDisk   Model: Cruzer Mini       Rev: 0.1

  Type:   Direct-Access                      ANSI SCSI revision: 02

usb 1-5: reset high speed USB device using ehci_hcd and address 3

```

and my /var/log/messages:

```
Aug  3 15:14:15 localhost usb 1-5: new high speed USB device using ehci_hcd and address 2

Aug  3 15:14:21 localhost usb 1-5: can't set config #1, error -110

Aug  3 15:14:21 localhost usb 1-5: new high speed USB device using ehci_hcd and address 3

Aug  3 15:14:27 localhost scsi0 : SCSI emulation for USB Mass Storage devices

Aug  3 15:14:27 localhost usb-storage: device found at 3

Aug  3 15:14:27 localhost usb-storage: waiting for device to settle before scanning

Aug  3 15:14:32 localhost Vendor: SanDisk   Model: Cruzer Mini       Rev: 0.1

Aug  3 15:14:32 localhost Type:   Direct-Access                      ANSI SCSI revision: 02

Aug  3 15:14:45 localhost scsi.agent[8118]: Attribute /sys/devices/pci0000:00/0000:00:02.1/usb1/1-5/1-5:1.0/host0/target0:0:0/0:0:0:0/type does not exist

Aug  3 15:16:29 localhost usb 1-5: reset high speed USB device using ehci_hcd and address 3

```

I believe udev is suposed to create /dev/sda and /dev/sda1 but it doesn't. (When it worked, it was /dev/sda1.) I have only /dev/sda2 through /dev/sda15. Also when I try to lsusb, the terminal freezes.

Any idea what's wrong?

Update: I'm now running gentoo-sources-2.6.14 and udev 071 and all is well with USB 2.0! Good things happen to those who wait.  :Very Happy: Last edited by cfgauss on Fri Nov 04, 2005 4:43 am; edited 1 time in total

----------

## plut0

Did you compile in SCSI, SCSI DISK, USB, USB Host Controllers and USB Mass Storage support in your kernel?  I think thats all you need...

----------

## jmbsvicetto

Hi.

If you feel the culprit could be udev, here are the relevant sections of my 50-udev.rules.

```
atl64 linux # grep usb /etc/udev/rules.d/50-udev.rules

# usb devices

KERNEL=="hiddev*",              NAME="usb/%k"

KERNEL=="auer*",                NAME="usb/%k"

KERNEL=="legousbtower*",        NAME="usb/%k", GROUP="usb"

KERNEL=="dabusb*",              NAME="usb/%k"

BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k", GROUP="lp"

KERNEL=="usblp",        NAME="%k", GROUP="lp"

atl64 linux # grep sd /etc/udev/rules.d/50-udev.rules

KERNEL=="sd*",          NAME="%k", GROUP="disk"

KERNEL=="dasd*",        NAME="%k", GROUP="disk"

KERNEL=="capi",         NAME="capi20", SYMLINK+="isdn/capi20", GROUP="dialout"

KERNEL=="isdn*"         NAME="%k", GROUP="tty"

atl64 linux # 
```

Hope this helps.

----------

## cfgauss

 *plut0 wrote:*   

> Did you compile in SCSI, SCSI DISK, USB, USB Host Controllers and USB Mass Storage support in your kernel?  I think thats all you need...

 

My .config, relevant parts:

```
CONFIG_SCSI=y

CONFIG_BLK_DEV_SD=y

CONFIG_USB_ARCH_HAS_HCD=y

CONFIG_USB_ARCH_HAS_OHCI=y

CONFIG_USB=y

CONFIG_USB_DEVICEFS=y

CONFIG_USB_EHCI_HCD=y

CONFIG_USB_OHCI_HCD=y

CONFIG_USB_OHCI_LITTLE_ENDIAN=y

CONFIG_USB_STORAGE=y

CONFIG_USB_MON=y

```

I'm using Gentoo AMD64.

Do I need more than this in the kernel?

----------

## plut0

I forgot to mention CONFIG_HOTPLUG.  Your kernel config looks good though.

----------

## cfgauss

 *plut0 wrote:*   

> I forgot to mention CONFIG_HOTPLUG.  Your kernel config looks good though.

 

I've got, in .config:

```
CONFIG_HOTPLUG=y

CONFIG_HOTPLUG_PCI=y

```

My lspci -v, relevant parts:

```
0000:00:02.0 USB Controller: nVidia Corporation CK804 USB Controller (rev a2) (prog-if 10 [OHCI])

        Subsystem: Micro-Star International Co., Ltd.: Unknown device 7125

        Flags: bus master, 66Mhz, fast devsel, latency 0, IRQ 193

        Memory at febff000 (32-bit, non-prefetchable)

        Capabilities: [44] Power Management version 2

0000:00:02.1 USB Controller: nVidia Corporation CK804 USB Controller (rev a3) (prog-if 20 [EHCI])

        Subsystem: Micro-Star International Co., Ltd.: Unknown device 7125

        Flags: bus master, 66Mhz, fast devsel, latency 0, IRQ 5

        Memory at febfe000 (32-bit, non-prefetchable)

        Capabilities: [44] #0a [2098]

        Capabilities: [80] Power Management version 2

```

The OHCI works but the EHCI doesn't. I wonder if the current ehci_hcd driver simply doesn't drive the nVidia chip.

----------

## cfgauss

 *jmbsvicetto wrote:*   

> Hi.
> 
> If you feel the culprit could be udev, here are the relevant sections of my 50-udev.rules.
> 
> ```
> ...

 

Here are mine:

```
/usr/src/linux> grep usb /etc/udev/rules.d/50-udev.rules

# usb devices

KERNEL=="hiddev*",              NAME="usb/%k"

KERNEL=="auer*",                NAME="usb/%k"

KERNEL=="legousbtower*",        NAME="usb/%k", GROUP="usb"

KERNEL=="dabusb*",              NAME="usb/%k"

BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k", GROUP="lp"

KERNEL=="usblp",        NAME="%k", GROUP="lp"

KERNEL=="sd*[!0-9]", ACTION=="add", ENV{ID_SERIAL}=="", IMPORT="/etc/udev/scripts/usb_id -x"

/usr/src/linux> grep sd /etc/udev/rules.d/50-udev.rules

KERNEL=="isdn*"         NAME="%k", GROUP="tty"

KERNEL=="sd*",          NAME="%k", GROUP="disk"

KERNEL=="dasd*",        NAME="%k", GROUP="disk"

KERNEL=="capi",         NAME="capi20", SYMLINK+="isdn/capi20", GROUP="dialout"

KERNEL=="sd*[!0-9]", ACTION=="add", SYSFS{ieee1394_id}=="*", IMPORT="/bin/echo -e 'ID_SERIAL=$sysfs{ieee1394_id}\nID_BUS=ieee1394\nID_TYPE=disk'"

KERNEL=="sd*[!0-9]", ACTION=="add", ENV{ID_SERIAL}=="", IMPORT="/etc/udev/scripts/usb_id -x"

KERNEL=="sd*[!0-9]", ACTION=="add", ENV{ID_SERIAL}=="", IMPORT="/etc/udev/scripts/scsi_id -g -x -s %p"

KERNEL=="sd*[!0-9]", ACTION=="add", ENV{ID_SERIAL}=="", IMPORT="/etc/udev/scripts/scsi_id -g -x -a -s %p"

KERNEL=="sd*[!0-9]", ACTION=="add", ENV{ID_SERIAL}=="?*", SYMLINK+="$env{ID_TYPE}/by-id/$env{ID_BUS}-$env{ID_SERIAL}"

KERNEL=="sd*[0-9]", ACTION=="add", IMPORT{parent}=="ID_*"

KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="$env{ID_TYPE}/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"

```

I didn't write them. They came with udev 065. Are they OK?

As an experiment, I put both ehci_hcd and ohci_hcd in the kernel as modules, put in the stick, inserted ohci_hcd, removed it, inserted ehci_hcd, and removed it. The ohci_hcd driver had no problems. The dmesg:

```
usb 1-7: new full speed USB device using ohci_hcd and address 3

scsi0 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 3

usb-storage: waiting for device to settle before scanning

  Vendor: SanDisk   Model: Cruzer Mini       Rev: 0.1

  Type:   Direct-Access                      ANSI SCSI revision: 02

SCSI device sda: 501759 512-byte hdwr sectors (257 MB)

sda: Write Protect is off

sda: Mode Sense: 03 00 00 00

sda: assuming drive cache: write through

SCSI device sda: 501759 512-byte hdwr sectors (257 MB)

sda: Write Protect is off

sda: Mode Sense: 03 00 00 00

sda: assuming drive cache: write through

 sda: sda1

Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

usb-storage: device scan complete

```

/dev/sda and /dev/sda1 both get created and all is well. When the stick is removed, both get destroyed.

When I use ehci_hcd alone, neither gets created and I get the dmesg from my original post. When I create /dev/sda and /dev/sda1 by hand and try to mount /dev/sda1, I get the message that /dev/sda1 "is not a valid block device."

Thanks for the suggestion. Any other ideas?

----------

## david.stevenson

 *Quote:*   

> When I upgraded from gentoo-sources-2.6.11 to gentoo-sources-2.6.12, I got my USB 2.0 memory stick to work for the first time. Now I'm at gentoo-sources-2.6.12-r7 and udev 065 and it now doesn't work (and hasn't for the last few kernels).

 

I have a problem with a USB card reader not creating /dev/sda. Which exact kernel version worked for you? And have you tried going back to it?

----------

## mentus

I'm having a similar problem here. My usb-key is dectected but no valid SCSI mapping is made. I've checked my kernel config and I have the relevant parts (SCSI, SCSI DISK, USB, USB Host Controllers and USB Mass Storage). What I have noticed though, is that my dmesg doesn't show a line of output shown on every other post I looked on the forums, namely:

```

scsi2 : SCSI emulation for USB Mass Storage devices

```

         The full output of the relevant parts of my dmesg are (after issuing: modprobe ohci-hcd, modprobe usb-storage, and pluging the USB key):

```

usb 1-2:1.0: hotplug

usb 1-2: unregistering device

usb 1-2: hotplug

hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x100

ohci_hcd 0000:00:02.0: suspend root hub

ohci_hcd 0000:00:02.0: GetStatus roothub.portstatus [1] = 0x00010101 CSC PPS CCS

hub 1-0:1.0: port 2, status 0101, change 0001, 12 Mb/s

hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101

ohci_hcd 0000:00:02.0: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES CCS

usb 1-2: new full speed USB device using address 3

usb 1-2: control timeout on ep0out

```

          I know the USB key is working and it's possible to make it work on Linux because it works flawlessly on Knoppix 3.7. The dmesg output there is as follows:

```

ohci_hcd 0000:00:02.0: wakeup

usb 1-2: new full speed USB device using address 2

scsi2 : SCSI emulation for USB Mass Storage devices

  Vendor:           Model:                   Rev:     

  Type:   Direct-Access                      ANSI SCSI revision: 02

SCSI device sda: 503521 512-byte hdwr sectors (258 MB)

sda: Write Protect is off

sda: Mode Sense: 00 c0 00 00

sda: assuming drive cache: write through

 sda: unknown partition table

Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0

USB Mass Storage device found at 2

```

           So my problem seems the  "SCSI emulation for USB Mass Storage devices" thing not being set up (god knows why).  What do you guys think?

----------

## jmbsvicetto

 *cfgauss wrote:*   

>  *jmbsvicetto wrote:*   Hi.
> 
> If you feel the culprit could be udev, here are the relevant sections of my 50-udev.rules.
> 
> ...
> ...

 

If you look carefully, your file is different from mine. I would suggest that you make a backup of yours and replace it with mine to test udev. However, I've just checked and it seems that I have an earlier version of udev.

```
atl64 linux # emerge -s udev

Searching...

[ Results for search key : udev ]

[ Applications found : 2 ]

...

*  sys-fs/udev

      Latest version available: 063

      Latest version installed: 063

      Size of downloaded files: 424 kB

      Homepage:    http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

      Description: Linux dynamic and persistent device naming support (aka userspace devfs)

      License:     GPL-2

atl64 linux #  
```

----------

## cfgauss

 *david.stevenson wrote:*   

>  *Quote:*   When I upgraded from gentoo-sources-2.6.11 to gentoo-sources-2.6.12, I got my USB 2.0 memory stick to work for the first time. Now I'm at gentoo-sources-2.6.12-r7 and udev 065 and it now doesn't work (and hasn't for the last few kernels). 
> 
> I have a problem with a USB card reader not creating /dev/sda. Which exact kernel version worked for you? And have you tried going back to it?

 

When I upgraded from gentoo-sources-2.6.11-r11 to gentoo-sources-2.6.12 it first worked and I haven't gone back to that kernel. My "workaround" now is just to take the 40x speed hit and use ohci_hcd (USB 1.1) rather than ehci_hcd (USB 2.0).

My box is dual-boot with WinXP x64 which does recognize the stick. Does anyone know how to check in WinXP whether the stick is using OHCI or EHCI?

----------

## FloppyMaster0

Open Device Manager and select "Devices by connection" from the View menu.

----------

## cfgauss

 *FloppyMaster0 wrote:*   

> Open Device Manager and select "Devices by connection" from the View menu.

 

Thanks.

My memory stick is being handled by the EHCI, USB 2.0, hub under WinXP x64 so I can rule out hardware problems. Since it once worked under gentoo-sources-2.6.12 and I believe that the ehci_hcd code hasn't changed since then, I suspect the problem is udev-related.

----------

## alet_roux

I have had some problems with non-creation of /dev/sdX before. I don't know if this will help you, but for me 

```
touch /dev/sda
```

 did the trick on this particular occasion. I'm running amd64 too, and have since moved on to bigger, better problems with ehci  :Sad:  (https://forums.gentoo.org/viewtopic-t-364695-highlight-.html).

----------

## cfgauss

 *alet_roux wrote:*   

> I have had some problems with non-creation of /dev/sdX before. I don't know if this will help you, but for me 
> 
> ```
> touch /dev/sda
> ```
> ...

 

Thanks for the suggestion. It doesn't seem to work in my case.

On the other hand, I seem to have exactly your symptoms, including freezing of the terminal when lsusb is attempted. Since I know my USB 2.0 hardware is OK, I guess I'll just wait for future kernels/udevs to magically fix things.

----------

## alet_roux

Have you tried the vanilla kernel yet? I might give it a go, to see if it improves things.

----------

## alet_roux

To answer my own question... yes, it does, at least for me! I'm now running vanilla-sources (2.6.11.11), and everything works exactly as it should.

----------

## homry

hi there,

i have a similar problem since i have recently switched to udev.

i also have usb-support, scsi, ehci and uhci included in my kernel.

i just dont get a /dev/sdX or /sys/block/sdX. fdisk doesnt show any sdX partitions.

basically i cannot use by usb-hd at all which works flawlessly with devfs.

i checked the threads for info but nothing helped till now. here is info from my dmesg:

usbcore: registered new driver usbfs

usbcore: registered new driver hub

usb 3-1: new low speed USB device using uhci_hcd and address 2

usbcore: registered new driver usblp

drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver

usbcore: registered new driver usb-storage

input: USB HID v1.10 Mouse [Logitech USB Mouse] on usb-0000:00:1d.1-1

usbcore: registered new driver usbhid

drivers/usb/input/hid-core.c: v2.0:USB HID core driver

usb 3-1: USB disconnect, address 2

usb 3-1: new low speed USB device using uhci_hcd and address 3

input: USB HID v1.10 Mouse [Logitech USB Mouse] on usb-0000:00:1d.1-1

usb 1-4: new high speed USB device using ehci_hcd and address 3

usb 1-4: USB disconnect, address 3

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

homry

/edit: problem solved. dunno how. did not changed anything, but it works now. apperently, if the usb-hd is plugged-in during booting, it does not get recognized sometimes.

----------

## alet_roux

Yes, there seems to be a problem with USB, especially disks. Since I posted on this forum last, I've tried a couple of other gentoo kernels (2.6.12's), and the problem with the non-appearing device node seems to have been solved. However, USB stops working if my pen drive is plugged in when the USB2 modules are loaded, for example at startup or if I do a manual modprobe ehci-hcd.

In vanilla kernels, this is not a problem at all.

----------

