Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm trying to create a udev rules that mount my USB CF reader to a specific /dev entry when it is connected in a specific port.
My 1st problem is that for some reason the ID of the USB port keeps changing, making my CF reader not recognizable by the system why is my system doing this??? The rules below works, but it is not consistent because of the ID change my system faces. If the USB ID is not consistent everytime I reboot, what would be? Note that I use different reader from time to time, therefore the udev PRODUCT ID would not be a solution.
The reason I'm creating such a udev rules....
Since I have a SATA drive in this computer it gets the "mapped" as /dev/sda, I have to find a way to mount CF card reader now and then from a script that I use. The problem is that for some reason, the device don't always get mapped as /dev/sdb. So I have to create a rule to have a consistent name (in my rule below: flashport1 or 2). I don't know if all this make sense, feel free to ask questions.
Code:
This is the command line I use to find out the ID of the USB port.
#udevinfo -a -p $(udevinfo -q path -n /dev/sdb1)
These are my rules, I have no choice to put many ID as they change for no reason.
BUS=="usb", ID=="6-4:1.0", NAME="flashport1" MODE="0644" OPTIONS+="all_partitions"
BUS=="usb", ID=="6-3:1.0", NAME="flashport2" MODE="0644" OPTIONS+="all_partitions"
BUS=="usb", ID=="1-3:1.0", NAME="flashport1" MODE="0644" OPTIONS+="all_partitions"
BUS=="usb", ID=="1-4:1.0", NAME="flashport2" MODE="0644" OPTIONS+="all_partitions"
BUS=="usb", ID=="3-3:1.0", NAME="flashport1" MODE="0644" OPTIONS+="all_partitions"
BUS=="usb", ID=="3-4:1.0", NAME="flashport2" MODE="0644" OPTIONS+="all_partitions"
Thanks
Claude
Last edited by cferron; 03-11-2008 at 10:31 AM..
Reason: Added clarification
The bus ID is dynamic so it will change. You can set up your rule based on the product ID instead, which will never change. I have not done that to the point where it will map to a specific dev entry but I posted a thread for a ptp camera with a udev rule:
I think that could help. You can see that instead of the bus ID you use the product ID and like I said I'm not sure how to map it to a specific dev entry. Let me know if that helps.
This is no good then. Since I use a different reader from time to time, the use of product ID would not help me at all. There must be something that is consistent from time to time!
I'm developping solution for photographer. I give them a reader, but what happend if they want to use their reader??? It would not work with my script This is not really a solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.