Click to See Complete Forum and Search --> : When I plug in a device, how do I know which /dev it is?


MDesigner
07-15-2004, 05:14 PM
When I plug something in like a USB drive or a 7-in-1 card reader (that'll be interesting), or an iPod, how do I find out what file in /dev Linux has decided to assign that device? Otherwise I won't know what to put in /etc/fstab in order to mount the device.

And on a related note, is there any way to have devices automatically mount when they're plugged in?

Hayl
07-15-2004, 05:21 PM
if it's the first scsi device it is /dev/sda (/dev/sda1, 2, 3, etc for each partition)

for the second scsi device it is /dev/sdb

c, d, e, f, etc

MDesigner
07-15-2004, 05:26 PM
Thanks!

nabetse
07-15-2004, 07:10 PM
And on a related note, is there any way to have devices automatically mount when they're plugged in?
There's a kernel feature called supermount. I read up on it when I was configuring my kernel with 'make menuconfig'. It works beautifully for me.
HTH

MDesigner
07-16-2004, 12:05 AM
Hmm... very weird. When I boot under kernel 2.4.26, the /dev/sda* devices exist.. but under 2.6.7, they don't. And under 2.4.26, there are certain modules running, like usbcore.. but when I do "modprobe usbcore" in 2.6.7, it says it doesn't exist.

I installed the modules off the Slackware 10 CD2.

AlienNation
07-16-2004, 01:50 AM
You can use the command "dmesg" after you plugged in your device to see what it's been assigned to. You can also use hotplug, autofs or a combination of both to get automatic mounting + run programs or scripts when a certain device is plugged in.