lm sensors

From Gentoo Wiki
Jump to: navigation, search

lm_sensors is a set of hardware monitoring user space utilities. They are helpful for tracking temperature, fan, and voltage.


Before lm_sensors will work as intended, the currently running Linux kernel must have the proper modules available to or built-in to the binary in order to give lm_sensors the sensor-related data needed for correct operation. There is a chance these modules have been previously built as modules or are currently included the Kernel's binary (built-in). It is also possible the Kernel is lacking the modules or features. If something is missing then the user will have to take the actions necessary to correct the absence.

In any case a simple hardware detection should be performed using the sensors-detect tool to scan the hardware on the motherboard. Once the hardware has been determined the program will display the output on what is or is not included in the kernel configuration. This step will be performed after installation during the configuration section below.

Another option is to check the Supported Device List on the official website. It is possible to enable all drivers and let the sensors-detect program do the work.


I2C support is needed along with the following kernel options:

KERNEL Enable I2C_CHARDEV and hardware Monitoring support in the kernel
Device Drivers  --->
    -*- I2C support  --->
        <*>   I2C device interface
    <*> Hardware Monitoring support  --->
        Select a driver, e.g.:
        [*] Intel Core/Core2/Atom temperature sensor (coretemp)

USE flags


Portage knows the global USE flag lm_sensors for enabling support for lm_sensors in other packages. Enabling this USE flag will pull in sys-apps/lm_sensors automatically once an emerge --changed-use is ran:

FILE /etc/portage/make.conf


Local USE flags include:

Optional USE flags for sys-apps/lm_sensors:
USE flag (what is that?) Default Recommended Description
sensord No Enable sensord - a daemon that can be used to periodically log sensor readings from hardware health-monitoring chips
static-libs No Build static versions of dynamic libraries as well


Presuming the global USE flag was set in /etc/portage/make.conf as suggested above update the system so the changes take effect:

root #emerge --ask --changed-use --deep @world


If all drivers were built into the kernel, skip to the next section and proceed with testing. Otherwise configure the modules as needed.


Be aware using sensors-detect to probe the hardware in the system may result in a frozen system. Take some special caution by reading the official documentation before running lm_sensors on IBM Thinkpads.

The sensors-detect (/usr/sbin/sensors-detect) tool can be used to find available sensors and associated kernel modules:

root #sensors-detect

Follow the instructions and answer the last question, whether /etc/conf.d/lm_sensors should be generated or overwritten by entering yes to the series of detection questions.



To start lm_sensors on system boot add it the default runlevel:

root #rc-update add lm_sensors default




Start lm_sensors now by running:

root #/etc/init.d/lm_sensors start


Now test if everything works:

user $sensors
Adapter: ISA adapter
Core 0:       +48.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:       +48.0°C  (high = +100.0°C, crit = +100.0°C)


See the lm_sensors FAQ.