LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   /dev entries (https://www.linuxquestions.org/questions/linux-hardware-18/dev-entries-40602/)

NSKL 01-07-2003 12:25 PM

/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

Aussie 01-07-2003 10:14 PM

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


NSKL 01-08-2003 09:43 AM

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

Aussie 01-08-2003 02:24 PM

If you have hotplug then dmesg should tell you what device it is.

moses 01-08-2003 02:43 PM

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.

NSKL 01-08-2003 03:41 PM

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

moses 01-08-2003 03:46 PM

love it.

Aussie 01-08-2003 03:48 PM

Hate it :-)


All times are GMT -5. The time now is 09:35 PM.