# 2.6.9 and USB mass storage

## ben_dash

I just graduated from genkernel to make menuconfig, so I'm still discovering all the options to choose from the menu.

My question is: "What options do I select to enable USB Mass storage devices?"

Currently nothing is showing up in dmesg.

Device Drivers -> USB Support -> USB device Filesystem is selected

Device Drivers -> USB Support -> USB mass storage support and USB mass storage verbose debug are selected

Any ideas?  I'm sure that I'm missing something simple

----------

## mentok

In order to use USB mass storage you need SCSI support, SCSI disk support, SCSI generic support, and SCSI emulation support (under block devices). The usb drive will appear as /dev/sda (a SCSI disk) or something like that.

----------

## ben_dash

yep - I already have SCSI disk support and SCSI generic support.  I don't see SCSI emulation under block devices, all I see there is:

```
  │ │ <*> Normal floppy disk support                                      │ │

  │ │ < > XT hard disk support                                            │ │

  │ │ < > Parallel port IDE device support                                │ │

  │ │ < > Compaq SMART2 support                                           │ │

  │ │ < > Compaq Smart Array 5xxx support                                 │ │

  │ │ < > Mylex DAC960/DAC1100 PCI RAID Controller support                │ │

  │ │ < > Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL)   │ │

  │ │ < > Loopback device support                                         │ │

  │ │ < > Network block device support                                    │ │

  │ │ < > Promise SATA SX8 support                                        │ │

  │ │ < > Low Performance USB Block driver                                │ │

  │ │ <*> RAM disk support                                                │ │

  │ │ (4096) Default RAM disk size (kbytes)                               │ │

  │ │ [*]   Initial RAM disk (initrd) support                             │ │

  │ │ [*] Support for Large Block Devices   
```

Any other ideas?

I have

```
Device drivers -> USB support -> USB Mass Storage support -> USB Mass Storage verbose debug
```

selected

Should I also select:

```
Device drivers -> USB support ->  USB verbose debug messages
```

I'm not sure that that would make a difference though, as dmesg data or not I can't mount my USB mass storage device that used to be on sda1 when I was using genkernel.  I'm getting:

 *Quote:*   

> bdash@alpha bdash $ mount /mnt/iRiverHP120
> 
> mount: special device /dev/sda1 does not exist
> 
> bdash@alpha bdash $ cat /etc/fstab |grep iRiver
> ...

 

----------

## kenyon

Are the modules getting loaded?  When I turn on my external USB hard drive, usb_storage loads.

----------

## tuam

 *ben_dash wrote:*   

> Device Drivers -> USB Support -> USB device Filesystem is selected
> 
> Device Drivers -> USB Support -> USB mass storage support and USB mass storage verbose debug are selected

 

Is it selected as module or not? What shows in dmesg if you boot without the iRiver plugged, and then plug it in?

FF,

 Daniel

----------

## Mben

try 2.6.10 if you cant make it work. i had problems with 2.6.9 and usb

----------

## buffalo

some USB mass storage are not standard, you have to activate ISD200 mass storage support (it was the case of my archos USBMS)

----------

## ben_dash

When I said "selected" I meant that it was not as a module, I meant compiled in.

I'm pretty sure that this device should work because it worked with the same kernel when I was using genkernel.

----------

## ben_dash

I added ISD200 mass storage support but still no difference, If I plug in any USB mass storage device I see nothing in dmesg:

 *Quote:*   

> bdash@alpha bdash $ dmesg
> 
> Linux version 2.6.9-gentoo-r4 (root@alpha) (gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)) #8 SMP Sat Jan 1 11:30:14 CST 2005
> 
> BIOS-provided physical RAM map:
> ...

 

----------

## tuam

 *ben_dash wrote:*   

> I added ISD200 mass storage support but still no difference, If I plug in any USB mass storage device I see nothing in dmesg:

 

I can't see how the USB devices are detected. See the relevant parts from my dmesg:

 *Quote:*   

> usbcore: registered new driver usbfs
> 
> usbcore: registered new driver hub
> 
> USB Universal Host Controller Interface driver v2.2
> ...

 

Please check if you have activated your chipset's driver.

FF,

 Daniel

----------

## bk0

Also enable Hotplug support and make sure you have the hotplug ebuild installed.

----------

## hielvc

You need "coldplug" nowdays.

----------

## ben_dash

Thanks for all the help so far!!!

I already had the hotplug ebuild installed and running in the default runlevel.

I just ripped hotplug out and replaced it with coldplug for the sake of keeping up to date..

I think that this may be the key, however, what I'm missing is that I think I have to emable sometihng in the kernel .config to enable coldplug, if so then what is it?

I scoured through and all I see is PCI hotplug but that's experimental and I had the feeling that that was not related.

Any ideas?

----------

## kenyon

The way I understand it, coldplug and hotplug are two separate concepts: Hotplug is where you can plug in/out devices without telling the system that you're going to do it.  Coldplug is where you tell the system what you're going to do first.  I also remember reading somewhere that coldplug will detect things that are already plugged in when you boot.

So I have them both installed and starting at the default runlevel, and it's working fine.  I don't think there's any special coldplug config in the kernel.  I just have CONFIG_HOTPLUG=y.

----------

## ben_dash

I just had a look at the USB mass storage howto for kernel 2.6:

 *Quote:*   

> 12.2. Kernel options
> 
> Kernel configuration options are very much the same as described in Section 5.2. The configuration menu (# make menuconfig) has been organized differently and more systematically. Here are the relevant choices:
> 
> 12.2.1. Bus options
> ...

 

And here are my settings from .config:

```
alpha linux # cat .config |grep CONFIG_HOTPLUG=

CONFIG_HOTPLUG=y

alpha linux # cat .config |grep CONFIG_SCSI=

CONFIG_SCSI=y

alpha linux # cat .config |grep CONFIG_SCSI_PROC_FS=

CONFIG_SCSI_PROC_FS=y

alpha linux # cat .config |grep CONFIG_BLK_DEV_SD=

CONFIG_BLK_DEV_SD=y

alpha linux # cat .config |grep CONFIG_USB=

CONFIG_USB=y

alpha linux # cat .config |grep CONFIG_USB_DEVICEFS=

CONFIG_USB_DEVICEFS=y

alpha linux # cat .config |grep CONFIG_USB_UHCI_HCD=

CONFIG_USB_UHCI_HCD=y

alpha linux # cat .config |grep CONFIG_USB_STORAGE=

CONFIG_USB_STORAGE=y

```

I don't see what I'm missing... it must be something obvious

----------

## kenyon

Maybe you need EHCI for USB2 support?

```
$ grep -i ehci /usr/src/linux/.config

CONFIG_USB_EHCI_HCD=m
```

----------

## ben_dash

I see what you mean about hotplug and coldplug.  I noticed that the gentoo handbook seems to have replace hotplug with coldplug, but I readded hotplug along with coldplug and I'm still not seeing anything in dmesg when I plug the USB device in.

I already have CONFIG_USB_EHCI_HCD compiled in:

```
alpha root # grep -i ehci /usr/src/linux/.config

CONFIG_USB_EHCI_HCD=y

# CONFIG_USB_EHCI_SPLIT_ISO is not set

# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
```

----------

## ben_dash

Darn, still haven't figured it out.

I plug in a USB device and dmesg says nothing.

I suppose I'll have to go back to genkernel.  I wonder what the problem is?

----------

## Cypr

Do you have Device Drivers > USB Support >  UHCI HCD (most Intel and VIA) support?

----------

## hielvc

You didnt list these, are they compiled in?  *Quote:*   

> 12.2.3. File systems
> 
> * Second extended (CONFIG_EXT2_FS ext2)
> 
> *
> ...

 

----------

## ben_dash

Yes I had UHCI built in, I also have the various fielsystems built in.

Any other ideas?

----------

## CptPajamas

Relevant options in my kernel:

(SCSI Stuff for SCSI emulation):

CONFIG_SCSI=y

CONFIG_BLK_DEV_SD=y

CONFIG_CHR_DEV_SG=y

(USB Stuff)

CONFIG_USB=y

CONFIG_USB_DEVICEFS=y

CONFIG_USB_EHCI_HCD=y

CONFIG_USB_OHCI_HCD=y

CONFIG_USB_STORAGE=y

CONFIG_USB_STORAGE_DEBUG=y

(below for HID / mice / keyboards, blah)

CONFIG_USB_HID=y

CONFIG_USB_HIDINPUT=y

CONFIG_USB_HIDDEV=y

DMESG output:

ACPI: PCI interrupt 0000:00:02.2[C] -> GSI 20 (level, high) -> IRQ 193

ehci_hcd 0000:00:02.2: PCI device 10de:00e8 (nVidia Corporation)

PCI: Setting latency timer of device 0000:00:02.2 to 64

ehci_hcd 0000:00:02.2: irq 193, pci mem ffffff0000014000

ehci_hcd 0000:00:02.2: new USB bus registered, assigned bus number 1

PCI: cache line size of 64 is not supported by device 0000:00:02.2

ehci_hcd 0000:00:02.2: USB 2.0 enabled, EHCI 1.00, driver 2004-May-10

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 8 ports detected

ohci_hcd: 2004 Feb 02 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)

ACPI: PCI interrupt 0000:00:02.0[A] -> GSI 22 (level, high) -> IRQ 177

ohci_hcd 0000:00:02.0: PCI device 10de:00e7 (nVidia Corporation)

PCI: Setting latency timer of device 0000:00:02.0 to 64

ohci_hcd 0000:00:02.0: irq 177, pci mem ffffff0000016000

ohci_hcd 0000:00:02.0: new USB bus registered, assigned bus number 2

hub 2-0:1.0: USB hub found

hub 2-0:1.0: 4 ports detected

ACPI: PCI interrupt 0000:00:02.1[B] -> GSI 21 (level, high) -> IRQ 185

ohci_hcd 0000:00:02.1: PCI device 10de:00e7 (nVidia Corporation)

PCI: Setting latency timer of device 0000:00:02.1 to 64

ohci_hcd 0000:00:02.1: irq 185, pci mem ffffff0000018000

ohci_hcd 0000:00:02.1: new USB bus registered, assigned bus number 3

hub 3-0:1.0: USB hub found

hub 3-0:1.0: 4 ports detected

Initializing USB Mass Storage driver...

usbcore: registered new driver usb-storage

USB Mass Storage support registered.

usbcore: registered new driver hiddev

usbcore: registered new driver usbhid

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

Upon Inserting USB Mass Storage Device (this is edited, since I have debug messages in my stuff):

usb 1-6: new high speed USB device using address 2

usb-storage: USB Mass Storage device detected

usb-storage: -- associate_dev

usb-storage: Vendor: 0x08ec, Product: 0x0008, Revision: 0x0100

usb-storage: Interface Subclass: 0x06, Protocol: 0x50

usb-storage: Vendor: Memorex,  Product: TD 2C

usb-storage: Transport: Bulk

usb-storage: Protocol: Transparent SCSI

scsi0 : SCSI emulation for USB Mass Storage devices

SCSI device sda: 1949696 512-byte hdwr sectors (998 MB)

sda: assuming Write Enabled

sda: assuming drive cache: write through

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

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

Make sure there's no funky setting in your BIOS; also, you can try booting a diagnostics CD like the Ultimate Boot CD (google for "UBCD") to make sure your USB is responding correctly.

ALSO:

Linux ****** 2.6.9-gentoo-r6_XPC_Optimized #11 SMP Mon Dec 13 13:05:39 MST 2004 x86_64 AMD Athlon(tm) 64 Processor 3500+ AuthenticAMD GNU/Linux

Just so you know it works in 2.6.9.

----------

## Mben

another thought:

you could check with the latest knoppix cd. 2.7 uses 2.6.9 if you use the cheat code. i think its knoppix26 at the boot prompt but click throught the f keys to be sure i  think the cheat codes are listed on f2 and f3 but im not sure, it says on the splash screen.

----------

## ben_dash

Thanks, I was missing one of the settings that you had compiled in.  I added the non VIA UHCI and CONFIG_USB_HIDDEV so I'm just about to boot and see what happens... fingers crossed...

----------

## ben_dash

Just something that I've been meaning to ask for ages, before I reboot and forget...

If you get this in your dmesg:

 *Quote:*   

> Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0

 

Does that translate to /dev/sda0 or is there some other way to guess where the device has been attached to.  Every time I plug in a new device it seems like I play "hunt the device" randomly until I find it.

Okay - rebooting now...

YESSSSSSS!!! It worked!!!

Thanks guys!  I'll ask for a .config sooner next time!

----------

