How to check CPU & Hard Disk temperature on Linux

If you would like to check hardware health like CPU temperature, hard disk temperature, fan speed, etc,. I would like to advise you to go with lm_sensors & hddtemp.

lm_sensors (Linux monitoring sensors) is a free and open-source application that provides tools and drivers for monitoring temperatures, voltage, and fans.

It’s a CLI utility and if you are looking for alternative tools. I would suggest you to go for s-tui : Stress Terminal UI is a terminal UI for monitoring your computer.

sensors is used to show the current readings of all sensor chips.

sensors -s is used to set all limits as specified in the configuration file.

sensors –bus-list is used to generate bus statements suitable for the configuration file.

sensors-detect is an interactive program that will walk you through the process of scanning your system for various hardware monitoring chips, or sensors, supported by libsensors, or more generally by the lm_sensors tool suite.

sensors-detect will look for the following devices, in order:

  • Sensors embedded in Super I/O chips.
  • Hardware monitoring chips accessed through ISA I/O ports.
  • Hardware monitoring chips reachable over the SMBus or more generally any I2C bus on your system.

hddtemp will give you the temperature of your hard drive by reading Self-Monitoring Analysis and Reporting Technology (S.M.A.R.T.) information on drives that support this feature.

Only modern hard drives have a temperature sensor. hddtemp supports reading S.M.A.R.T. information from SCSI drives too.hddtemp can work as simple command line tool or as a daemon.

These tool provides some essential command line utilities for monitoring these devices. Also, it helps you to find out a defective hardware components on your system.

How to install lm_sensor & hddtemp in Linux

There are various ways to install lm_sensor & hddtemp in Linux, depending on which Linux distribution you use.

Pre built packages are available in most of the Linux distribution official repository so, use the appropriate distribution Package Manager to perform the installation.

For Fedora system, use DNF Command to install TLP.

$ sudo dnf install lm-sensors hddtemp

For Debian/Ubuntu systems, use APT-GET Command or APT Command to install TLP.

$ sudo apt install lm-sensors hddtemp

For Arch Linux based systems, use Pacman Command to install TLP.

$ sudo pacman -S lm-sensors hddtemp

For RHEL/CentOS systems, use YUM Command to install TLP.

$ sudo yum install lm-sensors hddtemp

For openSUSE Leap system, use Zypper Command to install TLP.

$ sudo zypper sensors hddtemp

How to configure lm-sensors in Linux

Once you have installed, run the following command to configure lm-sensors in Linux. It will prompt you to confirm many times while you configuring the lm-sensors on your system and simply say YES to all.

sensors-detect will generate the /etc/conf.d/lm_sensors configuration file which is used by lm_sensors.service and defines the kernel modules to be loaded on boot.

$ sudo sensors-detect

# sensors-detect revision $Revision$
# System: LENOVO 80NV [Lenovo ideapad Y700-15ISK] (laptop)
# Board: LENOVO Allsparks 5A
# Kernel: 4.19.6-1-MANJARO x86_64
# Processor: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (6/94/3)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): YES
Module cpuid loaded successfully.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 17h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             Success!
    (driver `coretemp')
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Some Super I/O chips contain embedded sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): YES
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      No
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor/ITE'...               Yes
Found unknown chip with ID 0x8371

Some hardware monitoring chips are accessible through the ISA I/O ports.
We have to write to arbitrary I/O ports to probe them. This is usually
safe though. Yes, you do have ISA I/O ports even if you do not have any
ISA slots! Do you want to scan the ISA I/O ports? (YES/no): YES
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM79' at 0x290...       No
Probing for `Winbond W83781D' at 0x290...                   No
Probing for `Winbond W83782D' at 0x290...                   No

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): YES
Using driver `i2c-i801' for device 0000:00:1f.4: Sunrise Point-H (PCH)
Module i2c-dev loaded successfully.

Next adapter: SMBus I801 adapter at 6040 (i2c-0)
Do you want to scan it? (YES/no/selectively): YES

Next adapter: i915 gmbus dpc (i2c-1)
Do you want to scan it? (yes/NO/selectively): YES

Next adapter: i915 gmbus dpb (i2c-2)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: i915 gmbus dpd (i2c-3)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: DPDDC-A (i2c-4)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: nvkm-0000:01:00.0-bus-0000 (i2c-5)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: nvkm-0000:01:00.0-bus-0001 (i2c-6)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: nvkm-0000:01:00.0-bus-0002 (i2c-7)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: nvkm-0000:01:00.0-bus-0005 (i2c-8)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: nvkm-0000:01:00.0-bus-0006 (i2c-9)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: nvkm-0000:01:00.0-bus-0007 (i2c-10)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: nvkm-0000:01:00.0-bus-0008 (i2c-11)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: nvkm-0000:01:00.0-bus-0009 (i2c-12)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: nvkm-0000:01:00.0-aux-000a (i2c-13)
Do you want to scan it? (yes/NO/selectively): yes
Client found at address 0x18
Probing for `Analog Devices ADM1021'...                     No
Probing for `Analog Devices ADM1021A/ADM1023'...            No
Probing for `Maxim MAX1617'...                              No
Probing for `Maxim MAX1617A'...                             No
Probing for `Maxim MAX1668'...                              No
Probing for `Maxim MAX1805'...                              No
Probing for `Maxim MAX1989'...                              No
.
.
Probing for `Fintek F75121R/F75122R/RG (VID+GPIO)'...       No
Probing for `Fintek F75111R/RG/N (GPIO)'...                 No
Probing for `ITE IT8201R/IT8203R/IT8206R/IT8266R'...        No
Client found at address 0x77
Probing for `Asus Mozart-2'...                              No


Now follows a summary of the probes I have just done.
Just press ENTER to continue: 

Driver `coretemp':
  * Chip `Intel digital thermal sensor' (confidence: 9)

Do you want to generate /etc/conf.d/lm_sensors? (YES/no): YES
Created symlink /etc/systemd/system/multi-user.target.wants/lm_sensors.service → /usr/lib/systemd/system/lm_sensors.service.
Unloading i2c-dev... OK
Unloading cpuid... OK

Run the following command to view the CPU temperature.

$ sensors

nouveau-pci-0100
Adapter: PCI adapter
GPU core:     +0.60 V  (min =  +0.60 V, max =  +1.20 V)
temp1:         -0.0°C  (high = +95.0°C, hyst =  +3.0°C)
                       (crit = +105.0°C, hyst =  +5.0°C)
                       (emerg = +135.0°C, hyst =  +5.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +35.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +33.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +35.0°C  (high = +100.0°C, crit = +100.0°C)
Core 2:        +33.0°C  (high = +100.0°C, crit = +100.0°C)
Core 3:        +32.0°C  (high = +100.0°C, crit = +100.0°C)

Print the temperatures in degrees Fahrenheit instead of Celsius.

$ sensors -f

nouveau-pci-0100
Adapter: PCI adapter
GPU core:     +0.60 V  (min =  +0.60 V, max =  +1.20 V)
temp1:        +32.0°F  (high = +203.0°F, hyst = +37.4°F)
                       (crit = +221.0°F, hyst = +41.0°F)
                       (emerg = +275.0°F, hyst = +41.0°F)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +96.8°F  (high = +212.0°F, crit = +212.0°F)
Core 0:        +95.0°F  (high = +212.0°F, crit = +212.0°F)
Core 1:        +95.0°F  (high = +212.0°F, crit = +212.0°F)
Core 2:        +91.4°F  (high = +212.0°F, crit = +212.0°F)
Core 3:        +91.4°F  (high = +212.0°F, crit = +212.0°F)

To display hard disk temperatures.

$ sudo hddtemp /dev/sda2
/dev/sda2: WDC WD10SPCX-24HWST1: 32°C

Install Psensor in Linux

psensor is a graphical hardware temperature monitor for Linux. The application is designed to be simple and easy to use. The CPU and memory consumption are not significant.

It can monitor:

  • the temperature of the motherboard and CPU sensors (using lm-sensors).
  • the temperature of the NVidia GPUs (using XNVCtrl).
  • the temperature of ATI/AMD GPUs (not enabled in official distribution repositories, see the instructions for enabling its support).
  • the temperature of the Hard Disk Drives (using hddtemp or libatasmart).
  • the rotation speed of the fans (using lm-sensors).
  • the CPU usage (since 0.6.2.10 and using Gtop2).

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...