# Need USB storage help after udev migration

## TobiWan

Hi everybody,

I followed the Linux kernel 2.6 migration guide and now I run 2.6.9 with udev.

The trouble is that my /etc/fstab entries don't seem to work anymore, at least the USB storage mounts I defined have changed.

I still have a USB harddrive on /dev/sda1 which mounts fine but my Hama card reader with 4 slots I can't find anymore.

How do I find out which device I have to mount after I plug in the thing? The device nodes in /dev seem to be static now, there is no change between plugins there.

I started the hotplug daemon already, I compiled the necessary options into the kernel as modules and those are mounted and I enabled the multiple LUN option since the Hama card reader has four slots and I want to mount the third.

Who can explain to me how to mount the thing with udev?

thanks,

Tobias

----------

## Rcomian

Insert the required USB device and try:

```
cat /proc/partitions
```

That's all the partitions currently available to the kernel.

If nothing's there, try tailiing the kernel log

```
tail -f /var/log/messages
```

or

```
tail -f /var/log/everything/current
```

Then insert your usb device/storage card again. If nothing is found, it could be that your required usb kernel modules aren't being loaded.

There's been a change to the hotplug package which means it doesn't autoload any modules for you anymore (that's been moved to the coldplug package).

Try emerging and starting coldplug on boot, or alternatively, try this quick and dirty hack which tries to load as many modules as it can. :

```

#dirty script to load all the modules under the given directory

#Change this directory to load the appropriate set of modules

#Replace the kernel version below with your kernel version

cd /lib/modules/2.6.9-gentoo-r4/kernel/drivers/usb

ls -R | grep \.ko | sed -e "s/\(.*\)\.ko/\1/" | xargs -l modprobe 

```

(Sorry, I wrote that script whilst having a look at my own usb-pen and realised it didn't work anymore cos the modules weren't loaded, just thought I'd share).

Once all the modules are loaded, see if anything happens on the kernel logs when you insert a device, if still nothing, I'd guess the needed module isn't built.

Once you get the required message, the message should give you enough information to mount it, otherwise look at /proc/partitions again.

----------

## TobiWan

Hi Rcomian,

many thanks for this interesting answer. I learned some new stuff there.

Tailing the kernel when plugging in the device results in

 *Quote:*   

> 
> 
> Nov 18 23:45:37 [kernel] usb 2-2: new full speed USB device using address 11
> 
> Nov 18 23:45:37 [kernel] uba: device 11 capacity nsec 50 bsize 512
> ...

 

There's this entry in /proc/partitions

 *Quote:*   

> 
> 
> ...
> 
> 125     0         25 uba
> ...

 

It's gone when I plug the thing out.

It used to work under /dev/sdbx with x a number between 1 and four, representing one of the four slots for cards to read. I had to compile SCSI support with the option to scan multiple LUNs for the thing to recognise all four slots. I used the Gentoo sources with anything in the 2.6.8 series and devfs in the past when it still worked.

/dev/uba doesn't seem to be a mountable device though:

 *Quote:*   

> 
> 
> # mount /dev/uba1 /mnt/cardreader/
> 
> mount: /dev/uba1 is not a valid block device
> ...

 

I'm at a loss here. That cardreader has been the only way of getting images from my ancient, serial cable driven camera onto my PC.

An interesting thing to note is that the thing does not work either with a Mandrake Community 10.1 box that has a 2.6.8 kernel running with an automounter. On the other hand, that does not mean anything since I don't know if Mandrake compiled the multiple LUN option into the SCSI modules.

I don't think I need the coldplug stuff since I can still use my other USB storage device, an ordinary noteboot harddrive in a cheap USB cover. The fstab entry for that device still works so USB storage must work in principle.

For the record: the thing I'm having problems with is called a [i]hama 8 in 1 Card Reader USB 2.0[i], there is a number engraved on the case: 46945. Anybody who runs this thing succesfully with a recent kernel and udev?

thanks,

Tobias

----------

## Kovid

You need to disable the CONFIG_BLK_DEV_UB in your kernels .config and rebuild the kernel. The UB driver is probably taking precedence over the SCSI drivers for your device.

----------

## bk0

Yes, follow Kovid's advice. The USB block device driver is experimental and very buggy. Disable "Low performance USB block device" in the Block Devices section of the kernel config and enable "USB Mass Storage" Support in the Device Drivers -> USB Support section.

----------

## TobiWan

Hi,

 *bk0 wrote:*   

> Yes, follow Kovid's advice. The USB block device driver is experimental and very buggy. Disable "Low performance USB block device" in the Block Devices section of the kernel config and enable "USB Mass Storage" Support in the Device Drivers -> USB Support section.

 

Thanks a lot for all your help!

I had the first option compiled as a module, the same goes for the second. I disabled the first and now I'm running make to compile the kernel. I'll be back with results later.

bye,

Tobias

----------

## TobiWan

Hi all,

the matter is solved. Making the above mentioned changes fixes the problem.

Many thanks!

regards,

Tobias

----------

## xy77

Hello,

after migrating to udev, some of the partitions on my external harddisk are no longer present. The funny thing is: part of them are. Did anyone else happen to have a similar problem? Any hints are welcome.

- xy77

----------

## xy77

I guess it might help to provide some details:

plugging in usb hdd:

```

$ dmesg

hub 3-0:1.0: state 5 ports 5 chg ffe0 evt 0004

ehci_hcd 0000:0d:00.2: GetStatus port 2 status 001803 POWER sig=j  CSC CONNECT

hub 3-0:1.0: port 2, status 0501, change 0001, 480 Mb/s

hub 3-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x501

ehci_hcd 0000:0d:00.2: port 2 high speed

ehci_hcd 0000:0d:00.2: GetStatus port 2 status 001005 POWER sig=se0  PE CONNECT

usb 3-2: new high speed USB device using ehci_hcd and address 7

ehci_hcd 0000:0d:00.2: port 2 high speed

ehci_hcd 0000:0d:00.2: GetStatus port 2 status 001005 POWER sig=se0  PE CONNECT

usb 3-2: new device strings: Mfr=0, Product=1, SerialNumber=0

usb 3-2: default language 0x0409

usb 3-2: Product: USB TO IDE

usb 3-2: hotplug

usb 3-2: adding 3-2:1.0 (config #1, interface 0)

usb 3-2:1.0: hotplug

usbserial_generic 3-2:1.0: usb_probe_interface

usbserial_generic 3-2:1.0: usb_probe_interface - got id

ub 3-2:1.0: usb_probe_interface

ub 3-2:1.0: usb_probe_interface - got id

uba: device 7 capacity nsec 321672960 bsize 512

uba: device 7 capacity nsec 321672960 bsize 512

 uba: uba1 uba3 < uba5 uba6 uba7 >

```

```

$ fdisk -l /dev/uba

Disk /dev/uba: 164.6 GB, 164696555520 bytes

255 heads, 63 sectors/track, 20023 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/uba1               1         585     4698981   83  Linux

/dev/uba3             586       20023   156135735    5  Extended

/dev/uba5             586         651      530113+  82  Linux swap / Solaris

/dev/uba6             652         664      104391   83  Linux

/dev/uba7             665        1085     3381651   83  Linux

/dev/uba8            1086        2189     8867848+  83  Linux

/dev/uba9            2190        2446     2064321   83  Linux

/dev/uba10           2447       14605    97667136   83  Linux

/dev/uba11          14606       20023    43520053+   c  W95 FAT32 (LBA)

```

```

$ ls /dev/uba*

/dev/uba

/dev/uba1

/dev/uba3

/dev/uba5

/dev/uba6

/dev/uba7

```

Strange isn't it?

I use a 2.6.10 kernel with udev. Modules loaded:

```

$ lsmod

Module                  Size  Used by

sd_mod                 12736  0 

pcmcia                 17700  4 

snd_pcm_oss            49316  0 

snd_mixer_oss          17984  1 snd_pcm_oss

snd_seq_oss            32800  0 

snd_seq_midi_event      6272  1 snd_seq_oss

snd_seq                51088  5 snd_seq_oss,snd_seq_midi_event

snd_seq_device          7020  2 snd_seq_oss,snd_seq

ub                     15260  0 

ehci_hcd               41668  0 

ohci_hcd               33320  0 

psmouse                20392  0 

ltmodem               533072  0 

ndiswrapper           108420  0 

visor                  17292  0 

usbserial              26440  1 visor

usb_storage           102736  0 

scsi_mod               75168  2 sd_mod,usb_storage

yenta_socket           19392  1 

pcmcia_core            52320  2 pcmcia,yenta_socket

snd_maestro3           21028  2 

snd_ac97_codec         73792  1 snd_maestro3

snd_pcm                85732  3 snd_pcm_oss,snd_maestro3,snd_ac97_codec

snd_timer              21572  2 snd_seq,snd_pcm

snd_page_alloc          7748  1 snd_pcm

snd                    47812  14 snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_seq_device,snd_maestro3,snd_ac97_codec,snd_pcm,snd_timer

eepro100               26988  0 

mii                     4128  1 eepro100

```

Anyone able to locate the problem? Thanks.

- xy77

----------

## xy77

I got it!

It's probably not the best solution, but it works:

removed ub.ko from modules (actually via reconfiguration and make modules modules_install)

rmmod all xhci_hcd and usb-storage

modprobe ohci_hcd usb-storage

still a bit strange, but fine.

- xy77

----------

