LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 01-07-2003, 12:25 PM   #1
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 46
/dev entries


Im wondering how do i find out what /dev/ entry a device is assigned when connected if im not running devFS. For example i have usb 250 zip drive. If i keep it connected when i boot into linux, i can mount it via /dev/sda4, and i have IDE-SCSI emulation for my cdrom, and in the logs i can see it is assigned as /dev/sr0.
However the problem is when i connect the Zip drive while the computer is running. In the logs i see that linux recognized the device was conected, and that it was claimes by a driver (usb-storage) but i can not figure out what /dev entry to use to mount it. The same thing with my sony NW-E10 mp3 player that has flash memory. When i connect it, from the logs i see that linux recognizes a new device was conected, and sais that it is not claimed by any active driver, but does it still get a /dev entry? And how do i find out /dev entries. I looked at logs, and at /proc but i didnt find them (maybe i missed them??)
Is there a place where devices are assigned /dev entries where i can look them up?
Thanks
-NSKL
 
Old 01-07-2003, 10:14 PM   #2
Aussie
Senior Member
 
Registered: Sep 2001
Location: Brisvegas, Antipodes
Distribution: Slackware
Posts: 4,590

Rep: Reputation: 56
Have a poke around in the /proc directory, you can view the files with the 'cat' command, eg,
Code:
bern@aptiva:~$ cat /proc/bus/usb/devices
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc= 11/900 us ( 1%), #Int=  1, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB OHCI Root Hub
S:  SerialNumber=d0a6d000
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=03f0 ProdID=0205 Rev= 0.00
S:  Manufacturer=Hewlett-Packard
S:  Product=HP ScanJet 3300C
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 48mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=10(unk. ) Sub=01 Prot=00 Driver=usbscanner
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   1 Ivl=8ms
T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 11 Spd=12  MxCh= 0
D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=03f0 ProdID=0304 Rev= 1.00
S:  Manufacturer=Hewlett-Packard
S:  Product=DeskJet 810C
S:  SerialNumber=MY9CN150SYFY
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  2mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=07(print) Sub=01 Prot=01 Driver=usblp
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:  If#= 0 Alt= 1 #EPs= 2 Cls=07(print) Sub=01 Prot=02 Driver=usblp
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
 
Old 01-08-2003, 09:43 AM   #3
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Original Poster
Rep: Reputation: 46
I did poke around in /proc even before posting the original question, but i can't find to what /dev entry a device is assigned. O poked everywhere where i thought i'll find something useful, but no go. Lookes at /proc/scsi/usb-storage tree and /prc/bus /prc/devices etc, but although it sais what devices are attached, it doesn't say where (where in /dev) i can find them. Do i need to run DevFS to find out device names? There has to be a file somewhere that sais:
zip drive -- /dev/sda2
cdrom -- /dev/hdc
etc... or else how can you mount a device if you can't figure what entry it has been given? For example i just tried to mount my Zip drive again, that used to work as /dev/sda4 under slack 8.0, but not anymore (and i know its recognized and claimed by a driver, it sais so in /prc/scsi/usb-storage/0 ) but i cant find what /dev entry to use to mount it. Tried sda1 through 9..
Any help, or is the only solution DevFS, in which case it's not good, because DevFS doesn't keep permissions over reboots, so i must make a script and invoke it at start-up to give appropriate permissions for /dev under DevFS...
Thanks for any tips on finding what /dev to use for a ZIP 250 (SCSI) drive, and a NW-E10 mp3 player, usb conected, internal flash memory..
Thanks
-NSKL
 
Old 01-08-2003, 02:24 PM   #4
Aussie
Senior Member
 
Registered: Sep 2001
Location: Brisvegas, Antipodes
Distribution: Slackware
Posts: 4,590

Rep: Reputation: 56
If you have hotplug then dmesg should tell you what device it is.
 
Old 01-08-2003, 02:43 PM   #5
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 46
from this link:
http://www.linuxjournal.com/article.php?sid=6035

Quote:
This brings us to something that frustrates a lot of people when they first start using devfs. How do I get my permissions to come back after a reboot? This question has many answers: you can create a tarball of all the changed inodes prior to shutdown and then untar them during startup; you can store your permissions on a disk-based /dev and have devfsd copy and save them when starting up and shutting down; or you could simply add PERMISSIONS entries to your /etc/devfsd.conf file. Managing the device permissions for devfs in devfsd.conf via PERMISSIONS entries is great--you can have one entry for an entire group of devices. The following are some basic permissions I set up on my workstation:

REGISTER ^cdroms/.* PERMISSIONS root.cdrom 0660
REGISTER ^pty/s.* PERMISSIONS root.tty 0600
REGISTER ^sound/.* PERMISSIONS root.audio 0660
REGISTER ^tts/.* PERMISSIONS root.dip 0660

What those entries do is fairly simple. All the devices that are found under /dev/cdroms now have root as the owning user and cdrom as the owning group, with 0660 permissions, or u+rw g+rw o-rwx. I find this to be the easiest way to manage permissions. Using devfsd to manage permissions also prevents you from doing a quick chmod on a device when you first install it, telling yourself that you will set up the permissions correctly later and, of course, quickly forgetting that promise.
 
Old 01-08-2003, 03:41 PM   #6
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Original Poster
Rep: Reputation: 46
Ahh, although i read some DevFS docs, i must have skipped over this, because i remember reading that the easiest way is making a script. Anyway, this makes DevFS much more inviting. Thank you very much.
And just out of curiosity, of those who are reading this, who uses DevFS?
Thanks again
-NSKL
 
Old 01-08-2003, 03:46 PM   #7
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 46
love it.
 
Old 01-08-2003, 03:48 PM   #8
Aussie
Senior Member
 
Registered: Sep 2001
Location: Brisvegas, Antipodes
Distribution: Slackware
Posts: 4,590

Rep: Reputation: 56
Hate it :-)
 
  


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
/dev entries lord-fu *BSD 2 05-27-2005 08:52 AM
/dev entries changing their owner and permissions pulsosu Linux - Security 2 04-11-2005 06:19 PM
Missing /dev/video* entries Perrin7 Fedora 2 12-29-2004 06:39 AM
how are /dev entries created? quatsch Mandriva 3 03-10-2004 09:41 AM
unused dev entries a nuisance icyfire Slackware 6 12-13-2002 07:45 PM


All times are GMT -5. The time now is 06:44 AM.

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