Tip of the Trade: Hardware Discovery From Outside

Download the authoritative guide: Data Center Guide: Optimizing Your Data Center Strategy

Download the authoritative guide: Cloud Computing: Using the Cloud for Competitive Advantage

You don't have to open your computers to see what's inside, because Linux comes with a number of commands to tell you. lshw, or "list hardware," is one of them. Run it as root with no options: With lshw, Linux admins can find out what's under the hood -- without actually going under the hood. The "List hardware" command spits out a lot of information, including model numbers, motherboard features, chipsets, memory and drives.

# lshw
description: Desktop Computer
product: K7VT4APro
version: 1.0x

Discuss this article in the ServerWatch discussion forum

This spits out a lot of information, including model numbers, motherboard features, chipsets, memory and drives. Unless you have some seriously offbeat hardware, it should report detailed information on nearly everything on your system. You can then output it to a file in HTML format, for nice easy reading in a Web browser:

# lshw -html > filename.html

You can look for specific classes of devices, such as

# lshw -class disk

Run lshw -businfo to see what your different class options are. man lshw gives complete command options.

lshw has a few limitations. It won't, for example, detect Firewire (IEEE1394) devices or emulated SCSI-over-IDE devices.

lspci is a similar command that reports information about PCI buses and connected devices. lspci is commonly used to find the information needed to locate hardware drivers. Run it with no options for a short hardware list:

# lspci
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78)
01:00.0 VGA compatible controller: nVidia Corporation G73 [GeForce 7600 GS] (rev a2)

Add -v, -vv, or -vvv to get more details. Sometimes all you need are the device codes; get these with lspci -n. lspci -t provides a tree view. man lspci gives complete options.

Be sure to run the pciids-update command occasionally to keep your hardware ID database current. You don't have to be running Linux installed on a system to get the benefit of these commands — boot up a live Linux CD like Knoppix so you can use them on any system anywhere.

This article was originally published on Oct 8, 2007
Page 1 of 1

Thanks for your registration, follow us on our social networks to keep up-to-date