# Cardreader and udev: partition devices not created

## Loke

Hello,

dbus, hal, ivman and udev are working as expected for usb-sticks and cdroms, both dynamic modification of fstab and automounting to /media. However, I cant get udev to assign partition devices to the cards I plug into my USB X-in-1 cardreader. Some background info:

 *From dmesg wrote:*   

> 
> 
> Initializing USB Mass Storage driver...
> 
> scsi2 : SCSI emulation for USB Mass Storage devices
> ...

 

 *dmesg while plugging in a card wrote:*   

> 
> 
> SCSI device sdc: 512000 512-byte hdwr sectors (262 MB)
> 
> sdc: Write Protect is off
> ...

 

Ive tried two cards, one formated as fat16 (fstype msdos) and one as fat32 (fstype vfat), and they both come up with unknown partition type. The cards are formated, and in daily use in my camera and my cellular phone (so they are not faulty).

Ive looked at the writing-udev rules tutorial, however AFAICS ivman is notified whenever I plug or remove a card from the cardreader. Below Ive first inserted the card in the cardreader, and later (after white space) removed it :

 *tail -f /var/log/messages wrote:*   

> 
> 
> Dec 18 01:10:25 hugin SCSI device sdc: 246016 512-byte hdwr sectors (126 MB)
> 
> Dec 18 01:10:25 hugin sdc: Write Protect is off
> ...

 

Any suggestions welcome.

----------

## SnEptUne

I have a similar problem.  Although my cardreader is recognized and detected, there are no block device created.  When I plug in my usb card reader, my kernel would output:

```

Dec 22 14:57:34 workstation201 scsi.agent[8629]: disk at /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0/host0/0:0:0:0

Dec 22 14:57:34 workstation201 Vendor: Generic   Model: STORAGE DEVICE    Rev: 0128

Dec 22 14:57:34 workstation201 Type:   Direct-Access                      ANSI SCSI revision: 02

Dec 22 14:57:34 workstation201 Vendor: Generic   Model: STORAGE DEVICE    Rev: 0128

Dec 22 14:57:34 workstation201 Type:   Direct-Access                      ANSI SCSI revision: 02

Dec 22 14:57:34 workstation201 scsi.agent[8650]: disk at /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0/host0/0:0:0:1

Dec 22 14:57:34 workstation201 scsi.agent[8656]: disk at /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0/host0/0:0:0:2

Dec 22 14:57:34 workstation201 USB Mass Storage device found at 2

Dec 22 14:57:34 workstation201 scsi.agent[8684]: disk at /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0/host0/0:0:0:3

```

/sys/block doesn't show any new block device; however, there are new entries in /sys/bus/usb.

```

lrwxrwxrwx  1 root root 0 Dec 22 14:15 1-0:1.0 -> ../../../devices/pci0000:00/0000:00:07.2/usb1/1-0:1.0

lrwxrwxrwx  1 root root 0 Dec 22 14:57 1-2 -> ../../../devices/pci0000:00/0000:00:07.2/usb1/1-2

lrwxrwxrwx  1 root root 0 Dec 22 14:57 1-2:1.0 -> ../../../devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0

lrwxrwxrwx  1 root root 0 Dec 22 14:15 usb1 -> ../../../devices/pci0000:00/0000:00:07.2/usb1

```

Moreover, lsusb properly displayed my usb device.

```

# lsusb

Bus 001 Device 002: ID 05e3:0760 Genesys Logic, Inc.

Bus 001 Device 001: ID 0000:0000

```

By the way, what is your output of

```
# ls /sys/block
```

 and

```
# ls /sys/bus/usb
```

Do you have CONFIG_SCSI_MULTI_LUN enabled in your kernel?  Perhaps, we have the same problem.  It could be that my card reader is not compatible with linux though.

----------

## Loke

Yes, I got multiple LUNs enabled. I think this is an udev bug. Just try booting your computer with the card in place, and the device will be created. A rescan_scsi_bus script supposedly exists which circumvents the problem..

----------

## SnEptUne

Booting the computer with the card reader in place yields the same result.   I heard that it is a kernel problem, so I am going to update my kernel and udev and see if it works out.

[Edit]

Indeed, it is a kernel bug.  Using gentoo-dev-sources-2.6.9-r13 solved the problem.

----------

## Loke

Neither 2.6.9-r13 or 2.6.10-r4 seems to help me, still experiencing the same.

----------

## Zarhan

Also observed here, with kernel 2.6.15 and freshly installed HAL 0.5.5.1 + pmount. USB sticks work fine, cardreaders do not..

----------

