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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-21-2009, 01:45 PM
|
#1
|
|
Member
Registered: Feb 2008
Posts: 38
Rep:
|
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.
|
|
|
|
02-21-2009, 03:59 PM
|
#2
|
|
Member
Registered: Jan 2009
Location: Heaven
Distribution: Ubuntu 8.10 , openSUSE 11.1
Posts: 56
Rep:
|
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.
|
|
|
|
02-23-2009, 11:45 AM
|
#3
|
|
Member
Registered: Feb 2008
Posts: 38
Original Poster
Rep:
|
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
|
|
|
|
02-28-2009, 08:47 AM
|
#4
|
|
Member
Registered: Jan 2009
Location: Heaven
Distribution: Ubuntu 8.10 , openSUSE 11.1
Posts: 56
Rep:
|
Quote:
Originally Posted by carolus
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.
|
|
|
|
02-28-2009, 09:01 AM
|
#5
|
|
Senior Member
Registered: Jun 2008
Posts: 1,633
Rep: 
|
If you have it.
There is also the command lshw. See man lshw.
|
|
|
|
03-04-2009, 11:43 AM
|
#6
|
|
Member
Registered: Feb 2008
Posts: 38
Original Poster
Rep:
|
Quote:
Originally Posted by thorkelljarl
There is also the command lshw.
|
Sounds nice, but unfortunately not present in Knoppix DVD or Puppy Linux.
|
|
|
|
03-04-2009, 11:58 AM
|
#7
|
|
Senior Member
Registered: Jun 2008
Posts: 1,633
Rep: 
|
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.
|
|
|
|
03-04-2009, 12:15 PM
|
#8
|
|
Member
Registered: Feb 2008
Posts: 38
Original Poster
Rep:
|
debian-live lenny rescue cd also has lshw
|
|
|
|
03-04-2009, 06:54 PM
|
#9
|
|
Senior Member
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 4,579
|
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.
|
|
|
|
05-12-2009, 05:33 AM
|
#10
|
|
LQ Newbie
Registered: May 2009
Posts: 1
Rep:
|
udevinfo
Quote:
Originally Posted by carolus
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"
|
|
|
|
05-12-2009, 06:11 AM
|
#11
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
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."
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:55 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|