LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Card Reader + Udev not working (http://www.linuxquestions.org/questions/slackware-14/card-reader-udev-not-working-494706/)

bingo 10-22-2006 08:10 PM

Card Reader + Udev not working
 
I upgraded to Slack 11 with the huge26 kernel and udev about 2 weeks ago. I'm continuously reminded why I stick with this distro, I had everything running within about 2 hours!

The only problem I'm seeing is some wierd behavior with my SanDisk ImageMate 8-in-1 card reader. The reader does get recognized in "dmesg", and shows correctly in "lsusb". However, if I insert a card into the reader, nothing new will show up if I run "fdisk -l", and I can't mount /dev/sda1 (where it should be). If I try to mount /dev/sda, I'll get the error about specifying a filesystem type (not a surprise), then /dev/sda1 will show up with "fdisk -l", and I can mount it normally. I did not have this issue with hotplug, but I am with udev (hotplug is not activated or installed on my system). This condition not does occur with my usb jump drive or my ipod via usb.

On a side note, I have 728 items and 20 folders in my /dev directory. I thought that udev was supposed to dynamically add and remove the devices as required?

Thanks in advance for the help! ...Steve

David the H. 10-23-2006 10:27 AM

That doesn't sound like an excessive amount of device entries. My system has 655 items and 14 folders. Remember that this is all the devices the kernel knows about, plus some aliases and whatnot. Also notice that the vast majority of the entries are virtual terminal devices and not physical hardware (though I have always wondered why there are so many pty and tty entries).

I don't know how to help you, but you might try watching what happens with udevmonitor as you plug things in. It will give you more instantaneous feedback than watching dmesg or fdisk. I find it very useful for seeing just what udev is doing when something gets plugged in.

BTW, udev is supposed to be a replacement for hotplug, a combined hotplug and device manager in one package. I don't think you can have the old hotplug and udev together on the same system.

bingo 10-23-2006 09:36 PM

Thanks for the reply, that's good to know that my /dev directory isn't out of wack. I tried udevmonitor, and nothing comes up when I insert a card in the reader. With my jump drive and ipod, I see all of the expected results with udevmonitor. I have tried multiple types of cards in the reader with the same results as well. It was working fine when I was running 10.2 + 2.4.? + hotplug. Anything else I could try?

Mr_C 10-23-2006 10:35 PM

if fdisk -l doesn't bring it up this may not help but try cat /proc/partitions and see what you have.

syg00 10-23-2006 11:16 PM

Are you plugging thisin directly to the interface, or via a USB "extension" cable.
I had some issues on one system with a multi reader until I removed the extension cable.

Not Slack, but maybe worth a thought.

rkelsen 10-24-2006 12:12 AM

Are you inserting the card while the reader is plugged in? What happens if you unplug the reader, insert the card and then plug it in again?

bingo 10-24-2006 09:30 PM

Thanks again for the ideas... I am not using an extension usb cable, the reader is plugged directly into the port. If I insert the card before plugging the reader in, udev does assign the card a /dev block, but not if I insert the card after the reader is plugged in. I have not added any udev rules, it's stock. Could this be a bug? Pat has listed that the current udev has some issues and includes some alternate versions in /extra. Any other ideas? ...Steve

rkelsen 10-24-2006 10:33 PM

Quote:

Originally Posted by bingo
but not if I insert the card after the reader is plugged in.

What happens if you do this and then run /etc/rc.d/rc.scanluns ?

Personally, I never plug a card into a "live" reader anyway. It is good to know that this habit of mine also avoids this problem.

If the rc.scanluns trick works, then I don't believe that an earlier version of udev will help much.

marnold 10-25-2006 01:33 PM

Quote:

Originally Posted by bingo
Thanks for the reply, that's good to know that my /dev directory isn't out of wack. I tried udevmonitor, and nothing comes up when I insert a card in the reader. With my jump drive and ipod, I see all of the expected results with udevmonitor. I have tried multiple types of cards in the reader with the same results as well. It was working fine when I was running 10.2 + 2.4.? + hotplug. Anything else I could try?

Nothing will show up when you insert a card into a card reader. Nothing repeatedly polls the reader to see if anything has been inserted. Check this thread where I give the udev rules I added to get the Compact Flash and Secure Digital slots to work on my card reader. I also had to add

append="max_scsi_luns=5"

to my lilo.conf so that Slackware would scan for all of the slots on my reader.

dracolich 10-25-2006 03:29 PM

rkelsen is right. You have to insert the card before connecting the reader. After that run dmesg to see what device the kernel assigns the card to, such as sda1. Then you would mount the device, which you may root priveleges for depending on your system.

bingo 10-25-2006 06:38 PM

Thanks, at least I don't have anything set up incorrectly! Why could I do this with hotplug and not udev? My Windows machines will let me insert cards with the reader live as well, this seems like a limitation. Thanks again! ...Steve

dracolich 10-25-2006 06:48 PM

Windows automates a LOT more than *nix. In the windows world flash drives and disks are still mounted and unmounted just as we do in linux from the commandline, but it's all behind the scenes and invisible to the user. Some of the more user-friendly linux distros do automounting, but Slackware doesn't by default. It has to be enabled and I never bothered to learn how. I chose Slackware to get away from all that automation.

David the H. 10-25-2006 08:26 PM

I just bought a new a multicard reader last week and it detects new cards just fine while it's plugged in. So perhaps it depends on the hardware. Some readers may somehow let or allow the OS to know when a new card is inserted while others don't.

I seem to remember reading that the old hotplug system would occasionally scan for new devices or something like that, which is nice for the user but not good in a design sense (wasted resources, performance issues, and whatnot). udev is supposed to be much more 'pure' in its conception and doesn't do anything like that.

One thing udev can do is run a script or program when a device is added. Perhaps a script can be created that will run a device scan every few seconds for as long as the reader is plugged in?

bingo 10-25-2006 08:55 PM

Thanks to everyone for the help. David, it sounds like you explained the differences between hotplug and udev, that helps. Also, just to clarify, I don't have an issue with manually mounting devices, that is what I'm used to and appreciate. I just find it a hassel to have to unplug my reader every time I want to read a card. Thanks again! ...Steve

rkelsen 10-26-2006 07:17 AM

Quote:

Originally Posted by bingo
Thanks to everyone for the help. David, it sounds like you explained the differences between hotplug and udev, that helps. Also, just to clarify, I don't have an issue with manually mounting devices, that is what I'm used to and appreciate. I just find it a hassel to have to unplug my reader every time I want to read a card. Thanks again! ...Steve

Did you try the rc.scanluns trick I suggested in post #8?


All times are GMT -5. The time now is 07:43 AM.