Finding Hardware Details of your Linux Machine without Using Screw Driver


Points: 1 point, 58322 views Comments: 59 Comments User: Param

Many new Linux users have trouble determining the true specs of their Linux machine from command line. Linux GUI software's have evolved over past few years and provide the same details in very beautiful laid out manner; however an administrator/home-user may not have luxury of those tools on every machine.

So in this quick guide we will learn how to find specs of your Linux machine from command line. By the end of this guide you will be able to obtain full inventory of all components on your Linux machine within minutes. This should also help you in finding correct drivers and support for your hardware's chipset.

Part 1: Finding Hardware Details with lspci

lspci is a utility for displaying information about all PCI buses in the system and all devices connected to them. By default, it shows a brief list of devices. However you can use the various lspci options to request either a more verbose output or output intended for parsing by other programs.

[root@localhost ~]# lspci
00:00.0 Host bridge: Intel Corporation 82865G/PE/P DRAM Controller/Host-Hub Interface (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82865G Integrated Graphics Controller (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2)
00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)
03:08.0 Ethernet controller: Intel Corporation 82562EZ 10/100 Ethernet Controller (rev 02)
....

So now I know that my Graphics chip is “Intel Corporation 82865G Integrated Graphics Controller" and would take me a minute to search for drivers for that by searching the fine web. Here is the description of the line :

You may also use -v or -vv flags to display more information. When I used lspci -v, I get more details for my Graphic Chip

00:02.0 VGA compatible controller: Intel Corporation 82865G Integrated Graphics Controller (rev 02) (prog-if 00 [VGA])
Subsystem: IBM Unknown device 0285
Flags: bus master, fast devsel, latency 0, IRQ 185
Memory at f0000000 (32-bit, prefetchable) [size=128M]
Memory at e8000000 (32-bit, non-prefetchable) [size=512K]
I/O ports at 1800 [size=8]
Capabilities: [d0] Power Management version 1

Lspci utility reads some information from the PCI bus, and then collects additional information from its own database of hardware id's. This additional information is stored at /usr/share/misc/pci.ids and it contains information such as hardware-id, vendor, devices, classes and subclasses. Let's find our device in this file:

[root@localhost ~]# cat /usr/share/hwdata/pci.ids | grep "82865G Integrated Graphics Controller"
82865G Integrated Graphics Controller

As you can see our device is also listed in the hardware list. This hardware list is maintained at http://pciids.sourceforge.net, and you can use the update-pciids utility to download the most recent version.

Part 2: Finding Hardware Details with dmesg

dmesg is Linux command that is used to examine or control the kernel ring buffer. The program helps users to print out their boot-up messages.

Lspci worked well to discover our PCI devices but we want inventory of all devices on the system. Using dmesg we can view hardware details of everything detected by our operating system.

[root@localhost ~]# dmesg | less
Normal zone: 59248 pages, LIFO batch:15
DMI present.
Allocating PCI resources starting at 20000000 (gap: 10000000:eec00000)
Detected 2793.055 MHz processor.
Built 1 zonelists. Total pages: 63344
Kernel command line: ro root=/dev/VolGroup00/LogVol00 rhgb quiet
Enabling fast FPU save and restore... done.
Initializing CPU#0
CPU 0 irqstacks, hard=c07ae000 soft=c078e000
Memory: 244136k/253376k available (2139k kernel code, 8732k reserved, 866k data, 240k init, 0k highmem)
.....

As you can see dmesg gives you a lot of details, so we will use grep to restrict information to what we want. Let's say, we are interested in memory installed in the system.

[root@localhost ~]# dmesg | grep -i memory
Memory: 244136k/253376k available (2139k kernel code, 8732k reserved, 866k data, 240k init, 0k highmem)
Freeing initrd memory: 2124k freed
Total HugeTLB memory allocated, 0
Non-volatile memory driver v1.2
agpgart: Detected 8060K stolen memory.
Freeing unused kernel memory: 240k freed
.....

Similarly you can grep for whatever hardware you are trying to troubleshoot, for example CPU, USB etc.

Part 3: Finding Hardware Details from /proc

Sometimes you will want to monitor physical memory and CPU information on a running system in real time. For doing this, you will have to read the /proc file system. You might be thinking about `top` utility, but that utility also reads information from /proc file system. Make sure you only use `cat` command to view the information and do not change any of the files in /proc.

Doing an `ls` on /proc folder you will see various files and folders which contain information about your system.

Now let's start looking at what these files contain, starting with cpuinfo.

[root@localhost ~]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 2.80GHz
stepping : 9
cpu MHz : 2793.055
cache size : 512 KB
..

Now let's dig deeper and go inside a folder, I am going inside the `ide` folder and reading details for my hard disk.

[root@localhost ~]# cat /proc/ide/ide0/hda/driver
ide-disk version 1.18
[root@localhost ~]# cat /proc/ide/ide0/hda/capacity
78156288
[root@localhost ~]# cat /proc/ide/ide0/hda/model
IC35L060AVV207-0

Part 4: Getting More Information about your HDD using fdisk

In our last step using /proc, we obtained very basic information about our Hard Disk Settings. Now lets dig deeper by using `fdisk` command available in Linux. We will now try to obtain information about partitions, space available, space allocated, swap and more.

`fdisk` is the partition table manipulator tool for Linux. Generally hard disks are divided into one of more logical disks, also known as partitions. This partition information is stored in partition table found on sector 0 of the disk.

To display all partitions on your system, just type:

[root@localhost ~]# fdisk -l
Disk /dev/hda: 40.0 GB, 40016019456 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 4865 38973690 8e Linux LVM

And to view details of a particular drive, let say you have hda and hdb drives then type fdisk -l /dev/hda

Part 5 (UPDATE) : Reading BIOS information using dmidecode command

dmidecode tool dumps your system's DMI (Desktop Management Interface) table contents in a human-readable format. This table contains information regarding system's hardware components, as well as BIOS revisions etc. dmidecode output not only describes system current configuration, but also reports the BIOS limitations on supported CPU speed, Maximum Memory allowed and more.

Now lets say I want to restrict information to certain areas of DMI, I can do that by using the option -t and specifying what type of information I am interested in. For example, Processor Information is DMI type 4 and Memory Device is DMI type 17.

I hope this tutorial helps you as much as it helped my friend who was installing MythTV on Fedora and kept on opening his box for hardware details :)


Finding hardware details without using screwdriver

Thank you for an excellent and informative article. It will inspire me to replace the cover on my linux computer :-)

TonyH

Thanks for this interesting

Thanks for this interesting read

Lazy

Thanks...

Nice to have all these tips on one place. Thanks!

Use DMIDECODE

With dmidecode you can have a lot more info all on a single report

Interesting but...

Is it actually possible to tell for example what type of memory your computer takes, for example no. pins and speed and type....

Say I'm sitting at work and can log remotely into my home computer, could I get enough information to upgrade my RAM...?

I tried this once and couldn't work out how to - I got pretty close by working out the chipset on the motherboard, guessed between 2 types and got the wrong one :-(!!

Try using somehing else!

lshw is excellent for this.

Can come with a GTK interface too.

beginner post

This is pretty much beginner info...

Fancy seeing you here

An anonymous person says it's beginner info, but yet he obviously was searching for the information and ended up here to read it and comment on it. Even Linux gurus look up something they haven't used in a while or have forgotten. There are endless Linux commands and options. Some remember a good many of them, some don't.

I think the information here and the way it's presented is wonderful for both beginners as well as professionals that might need a memory refreshing.

Thanks for taking the time to make this for others and from the looks of it, many have found some use out of it. The added pictures are always a big help for many, as well. The information is clear, easy to understand and well formed. Good job.

amber
WorldClassifieds.ws

other cool utilities

Check out dmidecode as well. It's usually found in /usr/sbin on RedHat/Fedora and is also available via portage or from source (www.nongnu.org/dmidecode/).

It will tell you a lot about your system.

For disk info check out smartd and smartctl.

-Christopher Arnold (arnoldch AT yahoo-inc DOT com)

lsusb and the /sys file system

don't forget to look through the /sys filesystem. Some may be reduntant... but not everything.

and 'lsusb' to discover USB devices.

'sensors' to discover details about your RAM chips.

'dmesg': sometimes its overwritten by newer kernel messages. See /var/log/boot.log if it is.

on SUSE systems: you have a tool called 'yast2' for general system administration. It also includes details about your hardware. (for example on Dell servers with SUSE you can get the service tag number for the server.)

Very nice

Complete and concise. Thanks.

Mike

What about dmidecode?

Taken from the dmidecode manpage.

dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision.

--
Rene

Thank you,

or you could just click apple>about this mac>more info
And you can see right there everything.

Witch raises the question... Why Linux?
i suppose if you are poor its a good solution.

CLI vs GUI

At the top of his article he states that the GUI tools provide all this information, but for those who need a CLI version, here is the information...

Poor?

Not sure being poor necessarily has anything to do with it. Just because you can pay somebody to mow your lawn, clean your house, and do your grocery shopping doesn't mean you actually need those services. Nor does it mean your grass looks better, your house is cleaner, or your groceries taste better than your neighbors.

Which raises the question... Why Linux?

Well one nice thing about Linux is that it is not platform restricted. BTW what is the OS on your Mac?
Yes I know about apple>about this mac>more info. It or its equivalent has been there for 20 years or more, it even predate MS OFFICE.

RE: Witch raises the question... Why Linux?

That's a ridiculously ignorant statement (as well as misspelled) that doesn't really justify an explanation.

Click... Click...

Click apple... click about... click more... and more... and more...click... click

Man! The time you spent clicking your expensively nice Mac y listed 3 times my hardware info and checked my email from the console of my poor linuxbox :-)

Great stuff Man!

Especially useful if you don't even have physical access to the machine you're working on. Bravo my man!

-What a long strange trip it's been!
www.arty-dev.com

Re: dmidecode

Not sure if you have seen but you can get loads of information from dmidecode (BIOS level information). I find this helps.

dmidecode

Get bios info from a running OS.

dmidecode

doesn't work for all hardware platforms.

Now, if only I can find the

Now, if only I can find the cover to my computer!

Also

see the tools "lshw" and "dmidecode"

now that was usefull!

there are certain things in linux that i'd like to do, but somehow it's not trivial enough to be intuitive and i'm too lazy to look it up.

i first had this experience when i discovered the "du" command - after using linux for three years...
well, up till today i had no idea how to get hardware information, now i do, thanks :)

Don't forget dmidecode to

Don't forget dmidecode to tell many things about a bios and serial number of the box (if that's a bios thing, on most servers it is).

One more ...

Don't forget lsusb! Very usful. Just install the usbutils package for your distribution (at least Ubuntu and Fedora, probably others).

hdparm

hdparm can be used to find out more detailed information about hard drives

No HAL?

It might help to mention also, that if they are using a modern desktop environment, the command "lshal" should get them a wealth of information from HAL (the Hardware Abstraction Layer, aka Project Utopia).

Good stuff

Thats some useful stuff. Will check my box tonite :)

lshw

you can also use "lshw" it combines all info from all these tools in single list/display.

LSHW Not Working

particular server the "lshw" command not working...

Is LSHW Installed ?

LSHW is not installed by default on most of the flavors of linux. You may need to install it

Ignaramous

Which raises the question... Why Linux? i suppose if you are poor its a good solution.

I'm quite new to the world of computers and after spending the first few months using Windows pc`s i soon gave Linux Ubuntu a try and have now used it for about a month or two longer than i used Windows , but even i with my limited experience now knows enough now to KNOW that outrageous comments like that do nothing but show people like you up for the complete ignorant planks that you`se are...

Obviously someone who has either never tried Linux or possibly has tried it but found that like his spelling abilities his ability to learn something new with regards to an OS are sadly lacking..

Hence the outrageous remarks.

Great guide for those new users.....Linux and more specifically Ubuntu has made my last few months on a pc sooooo much more enjoyable than those first few months.Good stuff!!!

well done

Thank you
This has helped tremendously I have bookmarked this page I know it will come in useful again.

really good

really its help more way to find the hardware details in Linux machine

dmidecode command

this tools much useful in live server ,without restart take all hardware information of server..

thanks

Fantastic!!

Almost seven years working with Linux and I've never heard about dmidecode and lshw, it's really fantastic!! Good job man!

Thanks

To Poor ?

I have owned a Mac OSX Tiger and have recently bought a HP Media Centre Pavilion Laptop and successfully installed Ubuntu 64 Bit Edition on my Dual Core Turion AMD 64 and believe me when I tell you that it blows the socks off the PowerPC - all hardware is working along with 3-D Desktop and it was a huge educational and satisfactory experience building it.

The reason why I am reading this site is that I have now proved all my hardware works (in a true 64 Bit OS - BTW) and I now need an exhaustive hardware list for a Gentoo Installation on the same machine as I wan't the OS completely customized to my hardware specifications - this is what the Open Source Revolution is about mate - freedom of choice and empowerment to do what you want to do with your own property.

Stick to your shrink packed computer and leave the kernel building to the big boys.

Thanks for the article also bookmarked as it is exteremly informative.

dmidecode

dmidecode showing four processor but /proc/cpuinfo shows only one processor..

Why only one processor showing up in /proc/cpuinfo?

Hi Anonymous -

That's happening because you're not running an SMP (symmetric multi-processing) kernel. dmidecode shows you what CPUs you have in your machine (which is probably two dual-core CPUs) but /proc/cpuinfo tells you that the operating system only sees one.

You need to install the appropriate SMP kernel for your Linux - take a look at the package manager for your Linux distro.

regards
Ben

found at last..

i been looking around how to gather information without opening my computer case, now i found.. thanks, you're the man..

Excellent article

I've been looking for a guide like these for a long time.. Thanks for this post!

double thanks.

double thanks.

Not only did you list a lot of good stuff but you initiated getting others to add to it. Excellent.

Nice!

Just what I was looking for ;)

really very much useful

i like this tips really.

very nice things are provided.

very much helpful for the developers also....

Absolutely fantastic

Got what I was lookin for, simple and concise.. thanks

All In One

Very useful, thanks

thanx

thanks 4 all very very very very much !!!

thanks

I am installing Debian 4.0 - "Sarge" on Dell OptiPlex GX260 and your tutorial was very useful to me! Thank you!

thanks

I needed specs of my old lab machines to see which ones needed to be changed, and this helped a lot.
Thanks,
-A

Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <quote> <img>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.