LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-21-2009, 01:45 PM   #1
carolus
Member
 
Registered: Feb 2008
Posts: 45

Rep: Reputation: 15
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.
 
Old 02-21-2009, 03:59 PM   #2
andrew22
Member
 
Registered: Jan 2009
Location: Heaven
Distribution: Ubuntu 8.10 , openSUSE 11.1
Posts: 56

Rep: Reputation: 16
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.
 
Old 02-23-2009, 11:45 AM   #3
carolus
Member
 
Registered: Feb 2008
Posts: 45

Original Poster
Rep: Reputation: 15
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
 
Old 02-28-2009, 08:47 AM   #4
andrew22
Member
 
Registered: Jan 2009
Location: Heaven
Distribution: Ubuntu 8.10 , openSUSE 11.1
Posts: 56

Rep: Reputation: 16
Quote:
Originally Posted by carolus View Post
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.
 
Old 02-28-2009, 09:01 AM   #5
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,722

Rep: Reputation: 195Reputation: 195
If you have it.

There is also the command lshw. See man lshw.
 
Old 03-04-2009, 11:43 AM   #6
carolus
Member
 
Registered: Feb 2008
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by thorkelljarl View Post
There is also the command lshw.
Sounds nice, but unfortunately not present in Knoppix DVD or Puppy Linux.
 
Old 03-04-2009, 11:58 AM   #7
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,722

Rep: Reputation: 195Reputation: 195
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.

Last edited by thorkelljarl; 03-04-2009 at 12:10 PM.
 
Old 03-04-2009, 12:15 PM   #8
carolus
Member
 
Registered: Feb 2008
Posts: 45

Original Poster
Rep: Reputation: 15
debian-live lenny rescue cd also has lshw
 
Old 03-04-2009, 06:54 PM   #9
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,283

Rep: Reputation: 1089Reputation: 1089Reputation: 1089Reputation: 1089Reputation: 1089Reputation: 1089Reputation: 1089Reputation: 1089
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.
 
Old 05-12-2009, 05:33 AM   #10
Joe Kuan
LQ Newbie
 
Registered: May 2009
Posts: 1

Rep: Reputation: 0
udevinfo

Quote:
Originally Posted by carolus View Post
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"
 
Old 05-12-2009, 06:11 AM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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."
 
  


Reply

Tags
dev, device, mount


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
What device represent my audio CD? /dev/? lawrence_lee_lee Linux - Software 2 07-26-2008 06:55 AM
/dev/ttyACM0 in Hardware Info, but not present in /dev list linuxdreamz Linux - Newbie 4 08-17-2006 02:29 PM
Finding my /dev/hardware binarybob0001 Linux - Newbie 12 07-04-2005 04:41 PM
which /dev/ for what hardware jkh Linux - Newbie 4 03-03-2005 11:20 AM
hardware & the /dev directory? e1000 Linux - Hardware 4 01-03-2004 04:22 AM


All times are GMT -5. The time now is 05:51 PM.

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