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:
Device Drivers ---> -*- I2C support ---> <*> I2C device interface <*> Hardware Monitoring support ---> Select a driver, e.g.: [*] Intel Core/Core2/Atom temperature sensor (coretemp)
Portage knows the global USE flag
lm_sensors for enabling support for lm_sensors in other packages.
Local USE flags include:
USE flags for sys-apps/lm_sensors Hardware Monitoring user-space utilities
In case any of the packages having the
lm_sensors USE flag is installed, set the flag per package in /etc/portage/package.use or globally in /etc/portage/make.conf and update @world so that sys-apps/lm_sensors will be pulled in as dependency:
emerge --ask --changed-use --deep @world
Otherwise install it directly:
emerge --ask sys-apps/lm_sensors
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:
Follow the instructions, it will probe which sensors are available and load the relevant kernel modules.
The final question will allow you to write a config file in /etc/modules-load.d that contains the kernel modules that need to be loaded. This will only work if the
modules-load runscript is started, add it to the
default runlevel if necessary.
If you use
/etc/conf.d/modules to declare which kernel modules to load simply add the necessary kernel modules as shown by
sensors-detect to it.
To start lm_sensors on system boot add it the default runlevel:
rc-update add lm_sensors default
Start lm_sensors now by running:
Now test if everything works:
coretemp-isa-0000 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.