LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 02-15-2008, 04:45 AM   #1
kairen
Member
 
Registered: Oct 2006
Location: Bulgaria
Distribution: Slackware64 14.1
Posts: 88

Rep: Reputation: 15
Can I make a udev rule for a particular usb port?


I have two front usb ports. The first can mount an external disk and so that port is dedicated to it. The other one is for flash drives.

I made udev rules for the disk using it's vendor and model. Now I am looking for a way to assign a name to the flash port so it allways makes a node with the same name.

now I plug disk first -> /dev/sdb1, sdb2
then flash -> /dev/sdc1

if I change the order I get /dev/sdc1, /dev/sdc2 for the disk
and /dev/sdb1 for the flash
I want it allways to be "/dev/flash" when I use that particular port

Sorry for the dummy explanation - I wanted to be as clear as possible.



Thanks
 
Old 02-15-2008, 07:09 AM   #2
pdw_hu
Member
 
Registered: Nov 2005
Location: Budapest, Hungary
Distribution: Slackware, Gentoo
Posts: 346

Rep: Reputation: Disabled
You can't assign USB ports to device names.
As you've said that you've already created custom udev rules ("I made udev rules for the disk using it's vendor and model."), just create one for your flash drives to point to /dev/flash

Something like mine:
# Cruzer Mini 256MB
SUBSYSTEMS=="usb", ATTRS{serial}=="000080191" SYMLINK+="cruzer%n"
 
Old 02-15-2008, 08:13 AM   #3
kairen
Member
 
Registered: Oct 2006
Location: Bulgaria
Distribution: Slackware64 14.1
Posts: 88

Original Poster
Rep: Reputation: 15
ok
if I was to mount only one flash drive it is fine.

I have to be able to mount a dozen different flash drives. So I really can not make rules for all of them
 
Old 02-15-2008, 09:30 AM   #4
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,173

Rep: Reputation: 47
Quote:
Originally Posted by kairen View Post
ok
if I was to mount only one flash drive it is fine.

I have to be able to mount a dozen different flash drives. So I really can not make rules for all of them
Why not? If your goal is to have them all use the same /dev name that can be achieved with the SYMLINK+= rule element. In 10-local.rules make your rules for each flash drive and give them all the same SYMLINK name.

This should works as long as you never change your arrangement to have more than one flash drive connected at the same time.
 
  


Reply


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 Rule Help Please Toods Slackware 1 11-23-2007 09:55 AM
need help with udev rule hussam Linux - Software 2 12-05-2006 04:30 AM
udev rule for usbstick Steve50 Slackware 5 10-13-2006 06:53 AM
udev-Rule for Mobile tuxangler Linux - Hardware 1 03-28-2006 06:41 AM
Issues with adding a udev rule... Ateo Linux - General 1 03-04-2005 09:02 PM


All times are GMT -5. The time now is 10:59 PM.

Main Menu
Advertisement
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