Saturday, April 17, 2010

Getting to know the hardware of your Linux box

When you buy a new PC, laptop or server and install a Linux you want to know what hardware is actually in the Linux box and more importantly which piece of hardware is supported by the kernel out of the box and which needs special tweaking with modules to get it work.

Here is a list of commands which should help you to troubleshoot your hardware and find some information about it. This is not a ultimate troubleshooting guide but certainly will serve as a good starting point.


NOTE: some commands may not be avaiable for your platform after default installation as well as some commands may be distribution specific only.

1. What hardware is in my Linux box:
$ lspci

or
# dmidecode
2. What hardware is using which module.

NOTE:Root permissions are needed to execute this command:

# lspci -v

or
# lspci -vvv

or
# hardinfo

or
$ hardinfo ( GUI )

or
# lshw

or
# lshw-gtk  ( GUI )

or
# hwinfo
3. BIOS

Retrieve BIOS information:

# biosdecode

Retrieve BIOS vendor information:
# dmidecode -s  bios-vendor
4. Retrieve 
information about your motherboard only:
# dmidecode --type baseboard
5. What USB devices are 
plugged in:
$ lsusb
6. Graphic card information:
$ lspci | grep VGA
7. Check the 
size of the hard drive and partitions

Check the size of the hard drive and what hard drives are available in the system.

This command will also list USB drives and sticks. You need a root permissions to execute this command:
# fdisk -l | grep GB

Check what partitions and file system is in use on my hard drives:
# fdisk -l
8. Locate CD/DVD-ROM device 
file:
$ wodim --devices

or
$ wodim --scanbus
9. Modules

What modules are currently loaded:
$ lsmod

get a information about any particular module:
$ /sbin/modinfo module_name

remove modules:
# modprobe --remove module_name

load a modules to the kernel:
# modprobe module_name

What hardware is using which module.

NOTE:Root permissions are needed to execute this command:
# lspci -v

or
# lspci -vvv
10. Check for PCMCIA cards:
# lspcmcia
11. Processor type:
$ cat /proc/cpuinfo
or
# dmidecode --type 4

Is my processor using 32 or 64 bit instruction set:
$ cat /proc/cpuinfo | grep flags | grep lm

if you get some output you have 64 bit if no output is presented you are using 32 or even 16 bit CPU.

NOTE: grep command looks for lm flag.

12. RAM

How much RAM is installed in my Linux and how much of it is in use ( mega bytes ).

It will also include swap memory:
$ free -m

or
$ top

or
$ cat /proc/meminfo
13. Sound Card

Check sound card settings. This command will reveal whether your sound card is installed and what modules are in use:
$ cat /dev/sndstat
14. Available wireless cards:
$ iwconfig
15. What speed is set to FANs:
$ cat /proc/acpi/ibm/fan
16. Battery

Get a battery information on your laptop:
$ powersave -b
17. List Plug and Play BIOS 
device
# lspnp

No comments:

Post a Comment