System Administrator Dilemma #942: Send a Data Center Service Tech out to pop open the case to tell you what's in your system or use two simple commands.
Do you rely on proc files or dmesg to tell you everything you need to know about a system? If you do, you’re only seeing part of the picture. But what about when you want more detailed information about the system on which you’re working? Do you have to have the manufacturer’s spec sheet handy to know which components your system contains? It’s inconvenient to have someone open a system case in a remote data center to tell you how many memory DIMMs are in, or are not in, your target system. Linux systems include two native commands that tell you almost everything you need to know: dmidecode and biosdecode.
These two utilities live in the /usr/sbin directory and are standard Linux executables (not shell scripts). You must have root priveleges, via sudo or su -, to run either of these commands.
BIOSDECODE
The biosdecode command prints, to screen, information from BIOS memory about all of its known entry points. Entry point types are:
To show information about your computer, enter the biosdecode command at a prompt. Remember to use sudo or su -. The output shown is for my Linux system.
$ sudo biosdecode
# biosdecode 2.7
SMBIOS 2.3 present.
Structure Table Length: 2008 bytes
Structure Table Address: 0x000F0000
Number Of Structures: 46
Maximum Structure Size: 258 bytes
ACPI 1.0 present.
OEM Identifier: ACRSYS
RSD Table 32-bit Address: 0xAFFF3040
BIOS32 Service Directory present.
Revision: 0
Calling Interface Address: 0x000FADB0
PNP BIOS 1.0 present.
Event Notification: Not Supported
Real Mode 16-bit Code Address: F000:BA38
Real Mode 16-bit Data Address: F000:0000
16-bit Protected Mode Code Address: 0x000FBA10
16-bit Protected Mode Data Address: 0x000F0000
As you can see, my system doesn’t offer a huge amount of information or detail. Some systems show much more useful information. For example, if you have a Compaq, Sun, IBM or Sony system, your biosdecode output will display specific information about your system that generic ones (Acer), like mine, do not.
DMIDECODE
The more interesting and more verbose of these two commands is dmidecode. This command dumps the DMI or SMBIOS information, to screen, in a human-readable format. While this tool is respectable in terms of its speed and volume of information, the information could prove unreliable. As stated by dmidecode‘s authors (Alan Cox and Jean Delvare): “More often than not, information contained in the DMI tables is inaccurate, incomplete or simply wrong.”
As discomforting as the above statement seems, dmidecode can give you a “quick and dirty” peek into your hardware configuration. Matching its output against your proc files (cpuinfo, meminfo, pci) and dmesg information should provide you with enough verification to either accept its output or to send someone to the data center for a physical inspection.
For the moment, we’re going to consider the information displayed by dmidecode accurate. By default, dmidecode assumes that you want all of the information it has about your system. If you enter the command with no options at the command line, you’ll see that it directs pages of output to your screen.
$ sudo dmidecode
# dmidecode 2.7
SMBIOS 2.3 present.
46 structures occupying 2008 bytes.
Table at 0x000F0000.
Handle 0x0000, DMI type 0, 20 bytes.
BIOS Information
Vendor: Phoenix Technologies, LTD
Version: R01-B4
Release Date: 04/27/2007
Address: 0xE0000
Runtime Size: 128 kB
ROM Size: 512 kB
Characteristics:
ISA is supported
PCI is supported
PNP is supported
APM is supported
BIOS is upgradeable
...
Since this amount of information is a bit much to digest all at once, you can request specific information from dmidecode by using options. To have a look at all possible options, enter the following command.
$ sudo dmidecode -t
Type number or keyword expected
Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot
Now you have the ability to query specific DMI types from the DMI table. A type is a number (0 through 39) or one of the keywords shown above.
$ sudo dmidecode -t system
# dmidecode 2.7
SMBIOS 2.3 present.
Handle 0x0001, DMI type 1, 25 bytes.
System Information
Manufacturer: Acer
Product Name: Aspire E380
Version: R01-B4
Serial Number: PTS550X050723069912704
UUID: 001921EA-AD8E-2007-0606-082404000000
Wake-up Type: Power Switch
Handle 0x002C, DMI type 32, 11 bytes.
System Boot Information
Status: No errors detected
The DMI type numbers, shown below, used individually or in a comma separated list provide you with targeted information.
$ sudo dmidecode -t 1
# dmidecode 2.7
SMBIOS 2.3 present.
Handle 0x0001, DMI type 1, 25 bytes.
System Information
Manufacturer: Acer
Product Name: Aspire E380
Version: R01-B4
Serial Number: PTS550X050723069912704
UUID: 001921EA-AD8E-2007-0606-082404000000
Wake-up Type: Power Switch
$ sudo dmidecode -t 1,19
# dmidecode 2.7
SMBIOS 2.3 present.
Handle 0x0001, DMI type 1, 25 bytes.
System Information
Manufacturer: Acer
Product Name: Aspire E380
Version: R01-B4
Serial Number: PTS550X050723069912704
UUID: 001921EA-AD8E-2007-0606-082404000000
Wake-up Type: Power Switch
Handle 0x0027, DMI type 19, 15 bytes.
Memory Array Mapped Address
Starting Address: 0x00000000000
Ending Address: 0x000BFFFFFFF
Range Size: 3 GB
Physical Array Handle: 0x0022
Partition Width: 0
I know my system very well and the information reported from dmidecode is accurate but your mileage may vary. You can see the value and the amount of information extracted from biosdecode and dmidecode and why you need to know about these valueable tools.
If your system, gives you inaccurate information, please let us know and you should also report it to the developers. Send them as much info as you can, including the output and point out the inaccuracies to them.
Next week, you’ll learn how to use Access Control Lists (ACLs) to manage your users and groups.
Kenneth Hess is a Linux evangelist and freelance technical writer on a variety of open source topics including Linux, SQL, databases, and web services. Ken can be reached via his website at
http://www.kenhess.com. Practical Virtualization Solutions by Kenneth Hess and Amy Newman is available now.
Comments on "Linux System Information Decoded"
Best tool is hwinfo. It combines SMBIOS info with devices, hal, sysfs to give the best coordinated amount of info about your system.
You can also use lshw (http://lshw.org) that provides even more details than dmidecode,lspci,lsusb,lshal and hwinfo.
It has a command line interface and a GTK-based GUI.
I was just about to suggest lshw bug being that its already in the comments I\’ll add that lspci and lsusb can be very informative as well. The article on ACL\’s should be very helpful. I just recently got done figuring that all out and man does that ever make something that I\’ve wanted to do for years very simple and easy.
bummer. dmidecode fails after showing system information with \”DMI table is broken!\”
Excellent article….