LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 03-09-2008, 09:34 PM   #1
cferron
Member
 
Registered: Jan 2006
Location: Trois-Rivières, Québec, Canada
Distribution: Slackware, Ubuntu
Posts: 74

Rep: Reputation: 15
Question Udev rules and USB bus


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 09:31 AM. Reason: Added clarification
 
Old 03-11-2008, 07:18 AM   #2
MonctonJohn
Member
 
Registered: Aug 2007
Location: Canada
Distribution: Mint
Posts: 112

Rep: Reputation: 15
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:

http://www.linuxquestions.org/questi...t-work-612826/

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.
 
Old 03-11-2008, 09:05 AM   #3
cferron
Member
 
Registered: Jan 2006
Location: Trois-Rivières, Québec, Canada
Distribution: Slackware, Ubuntu
Posts: 74

Original Poster
Rep: Reputation: 15
Changing BUS ID!

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!


Thanks

Claude
 
Old 03-11-2008, 09:21 AM   #4
MonctonJohn
Member
 
Registered: Aug 2007
Location: Canada
Distribution: Mint
Posts: 112

Rep: Reputation: 15
You use two (or more) different readers?

The only thing I know that never changes is the product ID. You could setup each reader to use a different dev entry.

Reader 1: /dev/sdb1
Reader 2: /dev/sdc1

etc.

Hope that helps... like I said I don't think anything else other than the product ID remains constant.
 
Old 03-11-2008, 09:37 AM   #5
cferron
Member
 
Registered: Jan 2006
Location: Trois-Rivières, Québec, Canada
Distribution: Slackware, Ubuntu
Posts: 74

Original Poster
Rep: Reputation: 15
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.


Thanks for the help
 
  


Reply

Tags
compact, flash, id, reader, rules, udev, usb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
udev rtc rules manwichmakesameal Linux - Kernel 3 01-23-2007 10:16 PM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 03:43 AM
Udev rules working but... cferron Linux - Hardware 5 03-24-2006 02:46 AM
need help fixing my udev rules or ivman rules hedpe Linux - Hardware 2 03-18-2006 10:07 AM
Supermount or udev/D-BUS? LitlJay Fedora 1 08-06-2004 03:02 AM


All times are GMT -5. The time now is 08:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration