Posted by Steve on Fri 9 Dec 2005 at 13:20
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.