LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   which files in /dev actually represent hardware, and what hardware? (http://www.linuxquestions.org/questions/linux-newbie-8/which-files-in-dev-actually-represent-hardware-and-what-hardware-706464/)

carolus 02-21-2009 01:45 PM

which files in /dev actually represent hardware, and what hardware?
 
/dev usually has lots of entries, very few of which seem to represent hardware that is actually installed. Is there any way from the command line to find what hardware is where - in particular, where in /dev are those hardware items that can be mounted with a mount command? Or at least to screen out those entries in /dev that represent nothing?

lspci and lsusb will show installed hardware, but there doesn't seem to be any option that tells you where to find each item in /dev

Knoppix and Puppy show installed but unmounted hardware in the GUI, but the Debian Live Rescue Disk is strictly CLI, and anyway I would like to know a distro-independent CLI approach.

andrew22 02-21-2009 03:59 PM

Ok, /dev doesnt represent hardware, at least , not only. If you look at my signature, you will see that" /dev/pts/0 , if you type "tty" in a shell outside X, it will return something like that: /dev/tty2 Are these hardware, no no no. /dev are just a configuration and linking system, example, you go to /dev/sda1 , but you end up in /media/%Something%. Or you didnt meant that.

carolus 02-23-2009 11:45 AM

Getting not much response from others, I spent some time fooling around, and the best answer I can come up with is:

grep hd[a-z], sd[a-z], sr[0-9] on output from dmesg or from udevinfo -e

andrew22 02-28-2009 08:47 AM

Quote:

Originally Posted by carolus (Post 3454577)
Getting not much response from others, I spent some time fooling around, and the best answer I can come up with is:

grep hd[a-z], sd[a-z], sr[0-9] on output from dmesg or from udevinfo -e

http://kerneltrap.org/index.php?q=ma...1993/5/4/31646 <- Ignore the security risk, I have no idea what it is there.

thorkelljarl 02-28-2009 09:01 AM

If you have it.

There is also the command lshw. See man lshw.

carolus 03-04-2009 11:43 AM

Quote:

Originally Posted by thorkelljarl (Post 3460431)
There is also the command lshw.

Sounds nice, but unfortunately not present in Knoppix DVD or Puppy Linux.

thorkelljarl 03-04-2009 11:58 AM

Look here

I believe an Ubuntu 8.10 live-cd has the lshw package. The live-cd Parted Magic also has lshw among its attractions.

If you have knoppix or puppy installed, you can also of course install lshw.

carolus 03-04-2009 12:15 PM

debian-live lenny rescue cd also has lshw

sundialsvcs 03-04-2009 06:54 PM

On many (older...) systems, there are lots of "/dev" entries that merely correspond to devices that could exist.

More recent systems use a feature called udev that, by various (configurable) means, determines what devices actually do exist and constructs dev-entries for them. Furthermore, this system can handle removable devices: within a second or so of a device being plugged-in, a new entry will appear. (See also: hotplug; coldplug.)

It isn't my intention to explain the whys and wherefores of this subsystem here.

Joe Kuan 05-12-2009 05:33 AM

udevinfo
 
Quote:

Originally Posted by carolus (Post 3454577)
Getting not much response from others, I spent some time fooling around, and the best answer I can come up with is:

grep hd[a-z], sd[a-z], sr[0-9] on output from dmesg or from udevinfo -e

I hope this helps

Basically, ls -d /sys/block/[sh]d[a-z]*/[sh]d[a-z]*[0-9]*

and

udevinfo -a -p /sys/block/<dev>/<dev partition> --query=env that will give you a lot of useful information

Google: "How to extract storage device information without using dmesg"

pixellany 05-12-2009 06:11 AM

Quote:

Ok, /dev doesnt represent hardware, at least , not only. If you look at my signature, you will see that" /dev/pts/0
Where?

Quote:

/dev are just a configuration and linking system, example, you go to /dev/sda1 , but you end up in /media/%Something%.
/dev/sda1 would be MOUNTED at /media/something in order to access it thru the filesystem. It would be more correct to say: "If you go to /media/something, you would wind up at /dev/sda1."


All times are GMT -5. The time now is 03:54 PM.