Finding out basic information about your hardware

Posted by Steve on Fri 9 Dec 2005 at 13:20

Tags: , ,

If you've inheritted a bunch of machines, or have only a single generic server in front of you, then you might be curious to learn what hardware you have. Thnkfully it is very simple to discover information about your system, even remotely.

The initial things that you are liable to be interested in are the processor you're using and the amount of memory installed upon the host. Both of these can be identified by reading from the virtual /proc filesystem.

To discover the memory you have upon a system run:

skx@funny:~$ cat /proc/meminfo 
MemTotal:       516272 kB
...

Here the first line tells you that you have around 512Mb of memory installed.

To discover details about the processor(s) your host contains run:

skx@funny:~$ cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 11
model name      : Intel(R) Pentium(R) III Mobile CPU      1200MHz
stepping        : 1
cpu MHz         : 1196.258
cache size      : 512 KB
...

This lets us see that we have an Intel Pentium 3 processor, running at around 1200Mhz.

After you've looked at the basic information from these commands you can examine other hardware with more specialised tools. For example to list all the devices installed upon a PCI bus you can run:

skx@funny:~# apt-get install pciutils
skx@funny:~# lspci
..
0000:00:01.0 PCI bridge: Intel Corp. 82815 815 Chipset AGP Bridge (rev 04)
0000:00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev 03)
0000:00:1f.0 ISA bridge: Intel Corp. 82801BAM ISA Bridge (LPC) (rev 03)
0000:00:1f.1 IDE interface: Intel Corp. 82801BAM IDE U100 (rev 03)
0000:00:1f.2 USB Controller: Intel Corp. 82801BA/BAM USB (Hub #1) (rev 03)
0000:01:00.0 VGA compatible controller: nVidia Corporation NV11 [GeForce2 Go] (rev b2)
0000:02:03.0 Multimedia audio controller: ESS Technology ES1983S Maestro-3i PCI
..

This gives us a quick overview of the PCI contents, for more details add "-v", or "-v -v".

A similar process can be conducted against USB devices too, via the command lsusb contained in the usbutils package:

skx@funny:~# apt-get install usbutils
skx@funny:~# lsusb
Bus 001 Device 001: ID 0000:0000  

The final thing that can be useful in discover information about a system is the boot messages which scroll past when your system boots. This information will most likely scroll past too quickly to really absorb, and if you're booting a system remotely you'll not see it anyway.

To display the messages you can use the dmesg command :

skx@funny:~$ dmesg | less
Linux version 2.6.10-1-686 (dilinger@mouth) (gcc version 3.3.5 (Debian 1:3.3.5-8
)) #1 Fri Mar 11 03:55:46 EST 2005
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 0000000000100000 - 000000001ffea800 (usable)
 BIOS-e820: 000000001ffea800 - 0000000020000000 (reserved)
 BIOS-e820: 00000000feea0000 - 00000000fef00000 (reserved)
 BIOS-e820: 00000000ffb80000 - 0000000100000000 (reserved)
0MB HIGHMEM available.
511MB LOWMEM available.
On node 0 totalpages: 131050
  DMA zone: 4096 pages, LIFO batch:1
  Normal zone: 126954 pages, LIFO batch:16
  HighMem zone: 0 pages, LIFO batch:1
DMI 2.3 present.
ACPI: RSDP (v000 DELL                                  ) @ 0x000fde50
ACPI: RSDT (v001 DELL    CPi R   0x27d20419 ASL  0x00000061) @ 0x000fde64
ACPI: FADT (v001 DELL    CPi R   0x27d20419 ASL  0x00000061) @ 0x000fde90
ACPI: DSDT (v001 INT430 SYSFexxx 0x00001001 MSFT 0x0100000d) @ 0x00000000
ACPI: PM-Timer IO Port: 0x808
Built 1 zonelists
Kernel command line: root=/dev/hda1 ro 
...

This contains information about the drives your system contains, amongst other things. If you're running IDE based systems you can see the detected drives by looking inside the directory /proc/ide. For SCSI systems you can see the identified drives by looking inside /proc/bus/scsi.

 

 


Posted by Anonymous (82.130.xx.xx) on Fri 9 Dec 2005 at 13:36
dmesg has a short buffer, so maybe you should check in /var/log/kern.log

Information of IDE disks: hdparm -i /dev/hd? and hdparm -I /dev/hd?

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Fri 9 Dec 2005 at 13:39
[ Send Message | View Steve's Scratchpad | View Weblogs ]
dmesg has a short buffer,

True, but if you run it just after bootup then it shouldn't really be a problem.

Steve

[ Parent | Reply to this comment ]

Posted by Anonymous (195.5.xx.xx) on Fri 9 Dec 2005 at 13:45
You can try dmidecode too ( apt-get install dmidecode )

[ Parent | Reply to this comment ]

Posted by Anonymous (81.190.xx.xx) on Fri 9 Dec 2005 at 14:03
Well.. you might want to check lshw too ;-)

just `apt-get install lshw && lshw`

PS: I really apreciate this website - Good work.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Fri 9 Dec 2005 at 14:10
[ Send Message | View Steve's Scratchpad | View Weblogs ]

This is a lovely tool, and you're right I should have mentioned it. I just forgot because I was writing on a Sparc - and lshw isn't available for Sparcs, just x86 and some powerPC machines.

Otherwise it is highly recommended.

Steve

[ Parent | Reply to this comment ]

Posted by Anonymous (132.250.xx.xx) on Fri 9 Dec 2005 at 16:29
What about hwinfo? I don't see a difference in output between hwinfo and lshw, are they basically the same thing? They are both too detailed for many purposes, it would be nice to have a less-verbose mode.

[ Parent | Reply to this comment ]

Posted by cr0n (81.100.xx.xx) on Wed 3 Jan 2007 at 18:35
[ Send Message ]
when i run lshw using sudo it crashes my session...I cannot get back to the prompt...
It just says:
USB

Nothing else. Then i am stuck, whatever i type doesn't do anything (eg: exit, quit, CTRL+D, CTRL+C, etc...)
I have to terminate the session brutally and i can't even kill those lshw processes either :'(

Anyone has had this problem ? (running debian sarge i386 stable)

[ Parent | Reply to this comment ]

Posted by Anonymous (212.18.xx.xx) on Fri 9 Dec 2005 at 14:06
lshw
...is your friend

[ Parent | Reply to this comment ]

Posted by simonw (84.45.xx.xx) on Sat 10 Dec 2005 at 00:21
[ Send Message | View Weblogs ]
Remember though /proc/cpuinfo shows you a very specialist view.

If you have a Xeon, or other hyperthreaded processor (and you remembered to install an SMP kernel), you'll see several entries listed as "siblings". These indicate that it is different "bits" of the same processor. Siblings is the total number of siblings, so if the processor is treated as 2, you'll see two (Kind of like me saying I am one of two siblings, rather than I have one sister).

Discussed in depth on uk.comp.os.linux recently.

Forgetting to install an SMP kernel is my common mistake, and I doubt I'm alone in forgetting this, maybe the Etch installer should drop a hint.

[ Parent | Reply to this comment ]

Posted by Anonymous (62.254.xx.xx) on Sat 10 Dec 2005 at 18:53
lm-sensors is also great for reading sensor chip information from the motherboard, temperatures etc.

top notch thanks!

sno

[ Parent | Reply to this comment ]

Posted by Anonymous (217.76.xx.xx) on Sun 11 Dec 2005 at 09:59
I like mbmon as well, cause it doesn't have any kernel dependencies.

apt-get install mbmon && mbmon

[ Parent | Reply to this comment ]

Posted by Anonymous (82.119.xx.xx) on Mon 12 Dec 2005 at 01:16
juraj@monad:~$ sudo mbmon
No Hardware Monitor found!!
InitMBInfo: Success

:-(

hmm, this is a fairly new machine. Does it really have no dependencies on kernel?

[ Parent | Reply to this comment ]

Posted by Anonymous (212.78.xx.xx) on Wed 14 Dec 2005 at 08:52
I can also recommend the tool cfg2html, a bash script that collects loads of infos about the system and writes them into a single (huge) html file. it is available as a .deb-package.
http://come.to/cfg2html
obtaining it requires membership of the yahoo-group, but i can really recommend the tool.

[ Parent | Reply to this comment ]

Posted by Anonymous (213.216.xx.xx) on Sat 17 Dec 2005 at 06:04
If you just want a dump of host hardware, I'd recommend looking at a package and command called lshw. It, as the name implies, lists hardware.

[ Parent | Reply to this comment ]

Posted by Anonymous (216.65.xx.xx) on Tue 3 Jan 2006 at 23:10
http://servdoc.sourceforge.net/ is another handy option. No .deb that I'm aware of though.

[ Parent | Reply to this comment ]

Posted by Anonymous (66.28.xx.xx) on Sun 18 Jun 2006 at 09:47
what does it mean when the dmsg and /proc/cpuinfo aren't showing the same info?

[ Parent | Reply to this comment ]

Posted by Anonymous (24.18.xx.xx) on Wed 15 Nov 2006 at 19:25
to get lspci it's apt-get install pciutils

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

Which init system are you using in Debian?






( 1637 votes ~ 7 comments )