How do I troubleshoot hardware problems in a Linux system? (3)

Source: Internet
Author: User
Tags system log dmesg

How do I troubleshoot hardware problems in a Linux system? (3) 2013-03-27 10:32 51cto.com of nuclear coke translationfont Size:T | T

In the Linux system, the troubleshooting of hardware problems may be the most difficult task in the field of Computer Management, even if the experienced users sometimes encounter their own situation, this article share some practical skills and processing methods, hope to help readers understand, identify and finally solve the hardware problems.

AD:2014WOT Global Software Technology Summit Beijing Station course video release

DMESG command

Other valuable information is stored in the kernel buffer log, which we can usually invoke with the DMESG command. Of course, sometimes the log is saved in a file of the same name under the/var/log path. This command displays the kernel information in all buffers, some of which are also present in the standard system log-the/var/log/messages generated by the syslog.

In addition to this, DMESG also displays a large amount of hardware initialization information that we can use to explore possible problems or conflicts. Similarly, there will be a lot of abnormal content in this part of the information, reading and understanding will waste a lot of time, so please be targeted to deal with. The most interesting thing you should focus on is the module name and hardware address, which are strings of numbers and letters separated by colons.

In the following example, we can see the initialization of the Nvidia module. Because the module does not support the GPL, the system core is compromised-in addition, the initialization information for the sound card can be found in.

 Lsmod command

We have used the Lsmod command on many occasions before, and this command can be loaded into the system kernel with the name of the module and its number of uses. Before you can further analyze the process, you should first determine that the device has basic driver support. For example, if we want to understand why the NVIDIA graphics card is not working, we first have to figure out if the driver is loaded correctly or there is no conflict. While it may seem difficult for the average user to determine why the driver is not loaded, at least we have seen the root cause of the problem, which is a great achievement.

/sys/devices

Now let's look at a more practical way to check. Combining start-up information with DMESG while providing us with some basic information, this information is not very reliable. In cases where the authenticity of the information is not known, you need to review the kernel architecture and detect the loaded drivers directly.

In Linux systems, because of a single feature of the architecture, components are either compiled directly into the kernel or as modules that can be dynamically loaded. A module that communicates with hardware is called a driver. Whether you enter the kernel directly or become a loadable module, the component eventually resides in the kernel for some purpose. This is an abstract layer of software that users cannot control directly.

However, partial control in an indirect way is possible, and we can use the pseudo file system/proc and/sys to penetrate a subset of the kernel architectures. You can change the kernel architecture in real time by modifying seemingly ordinary files, which will change the way the system works. The/sys file system allows users to modify hardware and kernel modules.

Now, if you remember the numbers listed in the previous picture, we can make them useful. Browse subdirectories under/sys/devices and check which hardware components are already connected to the registration interface.

Some modules have writable parameters that we can modify with root privileges, which in turn change the way the hardware works. For example, the PCI slot of my LG notebook has a USB5 device on it, which happens to have a writable parameter. If you fill in this file with different values, you can start or turn off access to a particular USB interface.

In practice, you will find that browsing/sys is definitely a meticulous activity that requires a high level of experience and knowledge, especially when trying to solve a hardware problem. The average user's understanding of the different parameters and values is somewhat deficient, but it doesn't matter, I want to emphasize only one point:/sys directory can provide a lot of useful information

How do I troubleshoot hardware problems in a Linux system? (3)

Related Article

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.