View hardware information in Linux

Source: Internet
Author: User
Tags dmesg

View hardware information in Linux

Use the dmidecode command to view more


1. Identification of hardware in Linux;

 

In the linuxsir. org discussion area, we often see some brothers describe their hardware as follows: "My display card is made of XXX brands. What should I do if Linux does not support it ?". In fact, this is the worst description, and there is no way for everyone to help; because Linux's Hardware recognition is based on the chipset manufacturer rather than the hardware brand; most of the hardware manufacturers are OEM, which means that they cannot produce the main chip of the hardware, but they will take it from the main chip manufacturer and weld it to their own circuit board. This is the OEM process;

No matter what hardware is identified by the chipset manufacturer, rather than the brand on which the market sees it. For example, we can see a variety of video cards on the market, in fact, let's take a look at their chips, mostly from ATI and NVIDIA. All ATI and NVIDIA drivers are developed by ATI and NVIDIA. So when we ask a question, we need to say that the hardware chip is the only identifier of the driver, not the brand !!!

Therefore, when looking for a hardware driver, we must find the driver based on the information of the hardware master chip;

2. Tools for viewing hardware information in Linux;

In Linux, there is no tool to view the hardware chip information. It should be said that the Linux tool can view the hardware information more clearly. The following describes several common tools; the most commonly used tool is lspci; the other tools are just a bit of knowledge;

1. lspci lists all PCI devices;

Lspci-list all PCI devices, mainly used to list PCI devices on the machine, such as sound cards, video cards, cats, and NICs. The integrated motherboard devices can also be listed. lspci reads the hwdata database, hwdata is provided by the software package hwdata; there are about the following files;

[Beinan @ localhost ~] # Rpm-QL hwdata-0.158-1.
/Etc/hotplug/blacklist
/Etc/PCMCIA
/Etc/PCMCIA/config
/Usr/x11r6/lib/X11/cards
/Usr/share/doc/hwdata-0.158
/Usr/share/doc/hwdata-0.158/copying
/Usr/share/doc/hwdata-0.158/license
/Usr/share/hwdata
/Usr/share/hwdata/cardmonitorcombos
/Usr/share/hwdata/cards
/Usr/share/hwdata/monitorsdb
/Usr/share/hwdata/PCI. IDS
/Usr/share/hwdata/pcitable
/Usr/share/hwdata/upgradelist
/Usr/share/hwdata/USB. IDS

Lspci has two common parameters:-B and-V. lspci also lists the USB interfaces;

Example:

[Root @ localhost beinan] # lspci-B
. 0 host bridge: Intel Corporation 82852/82855 GM/GME/PM/GMV processor to I/O controller (Rev 02)
. 1 system peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV processor to I/O controller (Rev 02)
. 3 system peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV processor to I/O controller (Rev 02)
. 0 VGA compatible Controller: Intel Corporation 82852/855 GM integrated graphics device (Rev 02)
. 1 display controller: Intel Corporation 82852/855 GM integrated graphics device (Rev 02)
00: 1d. 0 USB controller: Intel Corporation 82801db/DBL/DBM (ich4/ICH4-L/ICH4-M) USB uhci controller #1 (Rev 03)
00: 1d. 1 USB controller: Intel Corporation 82801db/DBL/DBM (ich4/ICH4-L/ICH4-M) USB uhci controller #2 (Rev 03)
00: 1d. 2 USB controller: Intel Corporation 82801db/DBL/DBM (ich4/ICH4-L/ICH4-M) USB uhci controller #3 (Rev 03)
00: 1d. 7 USB controller: Intel Corporation 82801db/DBM (ich4/ICH4-M) usb2 EHCI controller (Rev 03)
00: 1E. 0 PCI Bridge: Intel Corporation 82801 mobile PCI bridge (Rev 83)
00: 1f. 0 ISA Bridge: Intel Corporation 82801dbm (ICH4-M) LPC interface bridge (Rev 03)
00: 1f. 1 ide interface: Intel Corporation 82801dbm (ICH4-M) ide controller (Rev 03)
00: 1f. 3 SMBus: Intel Corporation 82801db/DBL/DBM (ich4/ICH4-L/ICH4-M) SMBus controller (Rev 03)
00: 1f. 5 multimedia audio Controller: Intel Corporation 82801db/DBL/DBM (ich4/ICH4-L/ICH4-M) ac'97 Audio Controller (Rev 03)
00: 1f. 6 modem: Intel Corporation 82801db/DBL/DBM (ich4/ICH4-L/ICH4-M) AC '97 modem controller (Rev 03)
. 0 Ethernet controller: RealTek semiconduco., Ltd. RTL-8139/8139c/8139c + (Rev 10)
. 0 carw.bridge: Texas Instruments pcixx21/x515 carw.controller
. 2 FireWire (IEEE 1394): Texas Instruments OHCI compliant IEEE 1394 Host Controller
. 3 unknown mass storage controller: Texas Instruments pcixx21 integrated flashmedia Controller
. 4 class 0805: Texas Instruments pci6411, pci6421, pci6611, pci6621, pci7411, pci7421, pci7611, pci7621 Secure Digital (SD)

Analyze What devices are available on this machine. Check whether the devices are applicable to our applications;

. 0 VGA compatible Controller: Intel Corporation 82852/855 GM integrated graphics device (Rev 02)
. 1 display controller: Intel Corporation 82852/855 GM integrated graphics device (Rev 02) Note: This is a display card;
USB controller indicates the USB interface. We can see three of these devices. My laptop has exactly three USB interfaces;
Multimedia Audio Controller: Intel Corporation 82801db/DBL/DBM (ich4/ICH4-L/ICH4-M) ac'97 Audio Controller (Rev 03) Note: This is a sound card;
Modem: Intel Corporation 82801db/DBL/DBM (ich4/ICH4-L/ICH4-M) ac'97 modem controller (Rev 03) Note: This is a cat;
Ethernet controller: RealTek semiconduco., Ltd. RTL-8139/8139c/8139c + (Rev 10) Note: This is the NIC, the chip is 8139;
Firewire (IEEE 1394): Texas Instruments OHCI compliant IEEE 1394 host controller note: this is information about the 1394 Interface. In fact, my notebook also has this interface;

 

So what is the use of this information? If some devices on the machine do not support this function well, we can search for this information on Google. For example, I feel that my sound card is faulty, you can search for the solution based on the sound card information. Based on the information, you can go to the hardware chipset official website to find the answer or driver;

If you want to know more about the hardware, you can use lspci-V to view it;

[Root @ localhost beinan] # lspci-V

For example, we can use lspci-V to check the IRQ interruption of the hardware. For example, if the NIC is not easy to use, is there a conflict with the IRQ? If you do not know how to solve the hardware driver problem, you need to paste the entire segment of the lspci-V hardware information, which is the only solution to the problem; therefore, it is extremely important to learn to ask questions;

Some system releases and lsusb tools. Please try them yourself;

2. Storage Device viewing and operation tools;

We can see that the main tools for storage devices are fdisk, parted, and cfdisk. fdisk is the most commonly used and convenient tool. Parted should be a supplement. This tool is not very mature at present;

See:

Introduction to Linux commands for viewing disk partitions, file systems, usage, and related tools
How to Use fdisk for instance explanation

3. view the corresponding files in the/proc directory to obtain some hardware information;

We will notice this line when viewing/etc/fstab;

/Dev/proc defaults 0 0

Proc looks like a file system. In fact, it is not a real file system. It is "proc-Process Information pseudo-filesystem ", the process information disguising the file system;
"The proc filesystem is a pseudo-filesystem which is used as an interface to kernel data
Structures. It is commonly mounted at/proc. Most of it is read-only, but some files allow
Kernel variables to be changed ."

I will try to translate it and then understand it based on/proc. As an interface for Kernel kernel data structure, the proc file system refers to some kernel information (such as hardware information, including CPU, Nic, display card, memory, file system, and SCSI device ....) in the proc file system, the proc is written to the/proc directory by the Mont; in the/proc directory, most of the big data files are read-only, but some data changes according to kernel changes; the data in the/proc directory is subject to frequent changes. Each process in the system has a PID, which can be found in/proc; we can also view the process through PS-Aux | more;

We can use the cat command to read files in the/proc directory, such as CPU information;

[Root @ localhost beinan] # Cat/proc/cpuinfo

You need to check the details. It is also necessary to understand/proc;

4. dmesg

Dmesg is a tool used to display the system control information of the kernel buffer. For example, information about the system at startup is written to/var/log/

Note: The dmesg tool is not used to view the hardware chipset ID, but it allows us to know some hardware parameters in the machine, write hardware-related logs to the/var/log/message * Or/var/log/boot * file;

If we use this tool to view some hardware information, this tool is too informative and requires patience;

[Root @ localhost beinan] # dmesg

[Root @ localhost beinan] # dmesg-C note: the buffer zone is cleared and will be automatically generated the next time it is started;

5. hwbrowser

Hwbrowser is the graphical browser of your current hardware configuration. This tool is graphic. The system may not be installed by default. You must install it. In fedora 4.0, if Yum or APT can be used, the following command should be used for installation;

[Root @ localhost beinan] # Yum install hwbrowser
Or
[Root @ localhost beinan] # apt install hwbrowser
[Root @ localhost beinan] # hwbrowser

Of course, you can also find the RPM package on rpmfind.net or freshrpms.net to install

[Root @ localhost beinan] # rpm-IVH hwbrowser *. rpm

We recommend that you install the software package Update Tool Yum and apt to automatically resolve dependencies;

6. lshal and Hal-device-Manager

The hardware information can also be known through lshal and Hal-device-Manager. However, this tool is a bit difficult for new users, but I still need to introduce it;

[Root @ localhost beinan] # lshal

Hwbrowser is the graphical interface of lshal. The system may not be installed by default. This toolkit is a fedora extension package and needs to be installed. In fedora 4.0, if Yum or APT can be used, the following command should be used for installation;

[Root @ localhost beinan] # Yum install Hal-device-Manager
Or
[Root @ localhost beinan] # apt install Hal-device-Manager
[Root @ localhost beinan] # Hal-device-Manager

Of course, you can also find the RPM package on rpmfind.net or freshrpms.net to install

[Root @ localhost beinan] # rpm-IVH Hal-device-manager *. rpm

We recommend that you install the software package Update Tool Yum and apt to automatically resolve dependencies;

3. Different hardware have different configuration tools and corresponding configuration files;

Different hardware has different configuration tools and corresponding configuration files. For example, the configuration file for the display and display card is/etc/X11/Xorg. conf, for older Linux versions should be/etc/X11/x86config or X86Config-4, the Xorg or x86 configuration files also include the configuration and control of the mouse and keyboard in the x Desktop Environment;

The sound card configuration file is/etc/modprobe. conf or/etc/modules. conf;

The file system configuration file is/etc/fstab;

Sound Card Configuration tool, generally alsaconf

Of course, different releases also have corresponding hardware configuration or management tools. For example, Fedora Core 4.0 has the following hardware configuration or management tools;

[Root @ localhost beinan] # system-config-Mouse
[Root @ localhost beinan] # system-config-Network-tui
[Root @ localhost beinan] # gnome-system-Monitor
[Root @ localhost beinan] # system-config-network
[Root @ localhost beinan] # system-config-printer-Gui
[Root @ localhost beinan] # system-config-Soundcard
[Root @ localhost beinan] # setup

Of course, these graphical tools are not omnipotent, and their functions still have great limitations. Therefore, most of the hardware configurations are operated in text mode;

4. The hardware driver is supported by the kernel, but where is the driver stored?

The hardware driver must be supported by the kernel, whether we install the driver ourselves or the driver that comes with the kernel. If the hardware driver is supported by the kernel module, the driver directory is located in/lib/modules/kernel version/kernel/directory or/lib/modules/kernel version/kernel/DRIVERS directory;

[Root @ localhost beinan] # uname-R
2.6.11-1.1369 _ FC4
[Root @ localhost beinan] # ls/lib/modules/2.6.11-1.1369 _ FC4/kernel
Arch crypto drivers FS lib net sound

Note: The driver is only supported by the module method in the kernel, or the driver we have installed is located in the/lib/modules/directory. If the driver is directly placed in the kernel, it will not appear in the directory related to the/lib/modules driver;

5. What should I do if the hardware is not supported by the system?

If a Linux system does not support your hardware, there are two solutions: one is to download the driver and install it by yourself. Most of the Linux drivers are developed by the open-source community, the vendor provides a relatively small number of resources; sometimes it may also need to re-compile the kernel, mainly depending on what the internal description file of the driver says. Because the driver was originally supported by the kernel, compiling the kernel is also extremely normal;

It is worth noting that if we want to re-compile the kernel, we 'd better understand the hardware, such as the mouse, optical drive, soft drive, USB device, hard drive, file system ...... you must carefully check the information;

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.