Omg, The Card Reader Works!

Friday, 16th September, 2005 :: 07:46 - Tech

I’ve been struggling with getting my USB card reader that came with my HP 873n to work for ages… It used to work just fine, then started being wonky, then altogether quite working thanks to the magic of udev. Apparently udev is supposed to make everyone’s life a bit easier, but I think I still prefer the old /dev/sda1 way of doing things… because it worked for me. It provides for a very direct hardware/topography connection.

Anyway, apparently my card reader is a bit of a bastard. Either it doesn’t play well with usb hotplug, or it just doesn’t notify the kernel that a card has been plugged in.

The big problem is at boot four device nodes are created, sda, sdb, sdc, and sdd. In linux, you access a partition instead of the device, so… if I wanted to access my compact flash card I’d need to mount /dev/sda1. The kernel/hotplug/udev and all of the other sinister characters in this saga just wouldn’t cooperate and actually create a /dev/sda1 node, no matter how much I cursed at them.

I read and read and read some more… everything I could get my hands on about udev and usb card readers… but again my card reader is a bastard; the only way to differentiate which slot is which is by the scsi LUN. I think that really is short for LUNatic… Instead of having a unique product, model, etc, like some other card readers like Lexar, it just repeats the same song and dance for every slot. Seriously, it just likes to be enigmatic about itself, won’t even tell the kernel who made the thing.

I fiddled and fiddled and finally figured out how to persuade udev and the reader to work together on something for once. Instead of relying on the card reader to actually tell the kernel and udev family how many places it would like set for dinner, I’m just having udev set the entire table.


BUS="scsi", SYSFS{model}="USB Card Reader", KERNEL="sd*", NAME{all_partitions}="%k"

This little piece of magic causes a plethora of device nodes to explode onto /dev… sda1-15, sdb1-15,sdc1-15, and finally sdd1-15. This way /dev/sda1, etc, will always be there, so no more of that backtalk from mount about /dev/sda1 not existing, hah! Take that!

Comments are closed.