LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-26-2005, 09:05 PM   #1
joopndufus
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Rep: Reputation: 0
Assigning hardware paths


Hello,

I'm wondering if it's possible to assign a path to a certain piece of hardware that is plugged into my system. Basically I would like something like /dev/ipod when my ipod gets plugged in. I have both an external SATA drive and an Apple iPod. Depending on the order of when they are plugged in, they either are assigned to /dev/sda or /dev/sdb. As you can imagine, this greatly interferes with my scripts and my /etc/fstab file. So is there any way to specify how the device gets assigned it's /dev/ path?
 
Old 07-26-2005, 09:23 PM   #2
mhen
LQ Newbie
 
Registered: Jul 2005
Location: Portsmouth, England
Distribution: Gentoo
Posts: 8

Rep: Reputation: 0
are you using udev, devfs or a static /dev directory?
 
Old 07-26-2005, 09:29 PM   #3
joopndufus
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Code:
[jtkrol@joop ~]$ ps aux | grep dev
root       948  0.0  0.1   1640   560 ?        S<s  20:21   0:00 udevd
I think this means that I'm using udev, correct? Sorry for not posting more info. I'm running Fedora Core 4 on a Dell Inspiron 600m. Thank you!
 
Old 07-26-2005, 09:42 PM   #4
mhen
LQ Newbie
 
Registered: Jul 2005
Location: Portsmouth, England
Distribution: Gentoo
Posts: 8

Rep: Reputation: 0
I know that it is possible to do what you want with udev, it is one of the things that it was *designed* to do:
Quote:
Say that I have two printers - a HP laser printer and an Epson inkjet. When they are both plugged in and on, I have /dev/lp0 and /dev/lp1.
How do I know which node refers to which printer? There is no easy way. The first printer that got connected was assigned name "lp0", and the second "lp1". Plugging in my printers in a different order would swap the names here, and that would mess up my scripts that always expect my HP laser printer to be lp1.

However, if my HP laser printer got named lp_hp (as well as lpX) and my other printer got named lp_epson (as well as lpY), then my scripts could just refer to those names. udev magic can control this and ensure that these persistent names always point to the device that I intended.
Unfortunately, since I have never used udev, I don't know exactly how this is done, but you might find this useful (the source of the above quote):

http://www.reactivated.net/writing_udev_rules.html

Last edited by mhen; 07-26-2005 at 09:49 PM.
 
Old 07-26-2005, 10:25 PM   #5
joopndufus
LQ Newbie
 
Registered: Jul 2005
Posts: 4

Original Poster
Rep: Reputation: 0
So after I posted this, I stumbled upon this link for using an iPod with Gentoo:

http://gentoo-wiki.com/HOWTO_Using_a...oo_Linux#udevd

The section that I linked to has some information about creating a udev rule. In regards to my last post, does that mean I'm running udev? I'm assuming so, but I would like some confirmation!
 
Old 07-26-2005, 10:34 PM   #6
mhen
LQ Newbie
 
Registered: Jul 2005
Location: Portsmouth, England
Distribution: Gentoo
Posts: 8

Rep: Reputation: 0
since udevd is running, then yes, I would say that you are using udev.
 
  


Reply



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
assigning permissions ziox Programming 1 01-10-2005 09:13 AM
assigning a process id linuxprogrammer Linux - Newbie 4 07-21-2004 01:31 PM
Assigning services to interfaces seanro Slackware 2 03-16-2004 10:18 PM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 10:15 PM
assigning static ip vcheah Linux - Networking 5 12-25-2001 06:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:58 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
Open Source Consulting | Domain Registration