From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021219 Description of problem: I have a 6-in-1 USB card reader for reading Compact Flash, Smart Media, Secure Digital, Memory Stick, etc. I have been using the CF card slot successfully for several months as /dev/sda1. I just got a Memory Stick, and I could not mount it. I thought that it would be /dev/sda1, like the CF card, but I kept getting errors about not being able to read the partition table. It appears that the default kernel is not compiled with SCSI multiple LUNs (CONFIG_SCSI_MULTI_LUN), which this device needs to see all of the slots. Taking a look at /proc/scsi/scsi, Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: Model: USB Card Reader Rev: 1.07 Type: Direct-Access ANSI SCSI revision: 02 I see that the host/channel/id are 0 0 0, thus I needed to add LUNs 1, 2, and 3 (this is a four-slot device): echo "scsi-add-single-device 0 0 0 1" > /proc/scsi/scsi echo "scsi-add-single-device 0 0 0 2" > /proc/scsi/scsi echo "scsi-add-single-device 0 0 0 3" > /proc/scsi/scsi After these commands, I see the multiple LUNs in /proc/scsi/scsi: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: Model: USB Card Reader Rev: 1.07 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi0 Channel: 00 Id: 00 Lun: 01 Vendor: Model: USB Card Reader Rev: 1.07 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi0 Channel: 00 Id: 00 Lun: 02 Vendor: Model: USB Card Reader Rev: 1.07 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi0 Channel: 00 Id: 00 Lun: 03 Vendor: Model: USB Card Reader Rev: 1.07 Type: Direct-Access ANSI SCSI revision: 02 Looking at the logs shows me that the Memory Stick shows up as /dev/sdd1 (it is in the fourth slot). Once I create an entry in /etc/fstab for /dev/sdd1, I can mount it as a normal user. The question is why is CONFIG_SCSI_MULTI_LUN not set in the default kernel? Perhaps this should be an RFE, but I wanted to document this for other who may have the same problem. Version-Release number of selected component (if applicable): kernel-2.4.22-1.2115.nptl How reproducible: Always Steps to Reproduce: 1. Attach a USB mass storage device (USB multi-card reader) 2. Attempt to use a memory card that is not in the first slot Actual Results: I attempted to mount /dev/sda1, but it said that there was no device and it could not read the partition information. Attempting to mount /dev/sdd1 complained that it was not a valid block device. Expected Results: If multi-LUN support had been enabled, I could have mounted the device. Additional info: It is quite possible that there are problems with enabling multi-LUN support in the kernel, but there should be some way to work around this. Wouldn't it be possible to check /proc/scsi/scsi for USB card reader (amoung other things), and get hotplug (or some such) to run the scsi-add-single-device commands?
Thank you for your information: I have had one heck of a time getting the memory stick to being recognized. I had no idea it was this simple to solve: I'm not a Linux newbie, but I'm not a techie either. I suspect I'm not the only one having trouble with device. Thank you for documenting this.
multi-lun is a runtime option fwiw (well module parameter) We can't enable it by default because several devices will lock the entire scsi bus with this on; we have a whitelist for known-good devices where it's automatic and for others there's the module parameter
Created attachment 96188 [details] Adds multi-LUN support to USB storage hotplug What about something like this? This patch will add multi-LUN support to hotplug USB storage. I know it is a hack, but have you seen any problems with multi-LUNs on USB storage devices?
You can lell driver, how many LUN's you should use on device, but I had recerved 2 bugs: 1 - I can mnount my SD-Card, but only writing stable. Fun, isn't it? But I really need write only. 2 - If I plug Reader after USB-Disk (small 128MB device from KingMax) or vice versa, USB turnes off. It's really bad for my USB keyboard. Tell me, will situation be better in 2.6 or 2.4.23?
It is also possible to add a module option to /etc/modules.conf: options scsi_mod max_scsi_luns=255 This will allow multiple LUNs for all SCSI devices.
A quick note re Forrest's patch to the hotplug script I have a card reader that id's itsself as a "CardReader CF RW" It has no brand name however is one of these. http://www.ebuyer.com/customer/products/index.html?action=c2hvd19wcm9kdWN0X292ZXJ2aWV3&product_uid=54461 The only way to get Forrests patch to work with one of these is to ammend the string it is greping on to find the correct id.
(replying to comment #2) If I remember what Alan Cox said on the subject only some old harware do not like multi-lun. So it should probably be enabled by default for all usb readers.
The patch does not seem to work here with an old dual CF/SM reader (dpcm + sddr09 driver) The harware works fine at home with a custom (not Fedora) kernel. I'd be great if we could get support for 4-year-old harware in Fedora. I understand new hardware can be difficult to support, but this is very old stuff.
options scsi_mod max_luns=8 Please try a line like this in your /etc/modprobe.conf and make sure you are running the latest FC development kernel. This worked for my Belkin 8-in-1 USB2 flash device. You may need to try different numbers like "4" or "6". If the above workaround works, please reboot your system fresh, enable your USB device, mount a filesystem, then attach your dmesg output to this report.
Created attachment 99497 [details] dmesg output after adding scsi_mod option Here is the output from my machine on FC2test2 after updating to kernel-2.6.5-1.326. This works, although I seem to have found a bug in udev where it will not create sdd1 unless it is plugged in when the entire reader is plugged in. You will notice device 2 was when I plugged it in without a card in it, and device 3 was when it had a card in it as I plugged in the card reader. The stand-alone kernel would not recognize sdd unless I added the option to scsi_mod.
Dave, this should be enough information for the whitelist?
ugh, they get worse and worse.. this one is so bad, they decided not to put their name to it.. Vendor: Which makes it a little difficult to add to the whitelist.
options scsi_mod max_luns=2 works here with Bus 001 Device 004: ID 04e6:0005 SCM Microsystems, Inc. eUSB SmartMedia/CompactFlash Card Reader Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 16 idVendor 0x04e6 SCM Microsystems, Inc. idProduct 0x0005 eUSB SmartMedia/CompactFlash Card Reader bcdDevice 2.08 iManufacturer 1 SCM Microsystems Inc. iProduct 2 eUSB SmartMedia / CompactFlash Adapter iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 39 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 3 bmAttributes 0x80 MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 1 bInterfaceProtocol 1 iInterface 4 CBC Interface Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type none wMaxPacketSize 64 bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type none wMaxPacketSize 64 bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 3 Transfer Type Interrupt Synch Type none wMaxPacketSize 2 bInterval 32 Language IDs: (length=4) 0409 English(US)
Is should be "scsi add-single-device ...", not "scsi-add-single-device ...", at least in 2.6.7 kernel. Besides, it should look for /proc/scsi/usb-storage/X files because I have for example: cat /proc/scsi/scsi Attached devices: Host: scsi5 Channel: 00 Id: 00 Lun: 00 Vendor: SMSC Model: 223 U HS-CF Rev: 1.95 Type: Direct-Access ANSI SCSI revision: 02 cat /proc/scsi/usb-storage/5 Host scsi5: usb-storage Vendor: SMSC Product: 223 USB97C223 Serial Number: 031017200000 Protocol: Transparent SCSI Transport: Bulk Quirks: So grepping for "USB Card Reader" does not really work.
This was NEEDINFO-ed by Warren, I think wrongly. The status is clear, I do not need any more information to close this. Whitelisting information needs to be taken upstream, indeed. At the very least, separate bugs are needed for entries. I have a little project, called "ub", which solves the problem of automatic probing without module parameters by trusting the USB protocol's max LUN request. It may appear in FC4 (FC3 if we are very lucky)