Linux Monitor Hard Disks Temperature With hddtemp

There is an excellent little utility to monitor hard drive temperature. Most modern computer hard disk including SSD comes with S.M.A.R.T (Self-Monitoring, Analysis, and Reporting Technology). It is a monitoring system for computer hard disks to detect and report on various indicators of reliability, in the hope of anticipating failures.

Monitor Hard Disks Temperature With hddtemp

The hddtemp or smartctl utility will give you the temperature of your hard drive by reading data from S.M.A.R.T. on drives that support this feature.
Linux Monitor Hard Disks Temperature With hddtemp
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 a simple command line tool or as a daemon to get information from all servers.

How to install hddtemp on Linux

To install hddtemp on a a Debian / Ubuntu Linux use apt-get command/apt command:
$ sudo apt-get install hddtemp
Sample outputs:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 47.7 kB of archives.
After this operation, 185 kB of additional disk space will be used.
Get:1 bionic/universe amd64 hddtemp amd64 0.3-beta15-53 [47.7 kB]
Fetched 47.7 kB in 0s (276 kB/s)   
Preconfiguring packages ...
Selecting previously unselected package hddtemp.
(Reading database ... 166286 files and directories currently installed.)
Preparing to unpack .../hddtemp_0.3-beta15-53_amd64.deb ...
Unpacking hddtemp (0.3-beta15-53) ...
Setting up hddtemp (0.3-beta15-53) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.24) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ... 

To install hddtemp under a CentOS/RHEL/SL/Oracle Linux, run yum command (first turn on EPEL repo):
$ sudo yum install hddtemp
Type the following pacman command to install hddtemp under an Arch Linux distro:
$ sudo pacman -S hddtemp
Type the following dnf command to install hddtemp under a Fedora Linux distro:
$ sudo dnf install hddtemp
Type the following zypper command to install hddtemp under an OpenSUSE Linux distro :
$ sudo zypper install hddtemp

Related: How to check CPU temperature in OpenSUSE Linux

A note about source code installation

You can also perform source code installation. Download the source code tar ball here.
$ wget
Untar and install hddtemp using the following commands:
$ tar -jxvf hddtemp-0.3-beta15.tar.bz2
$ cd hddtemp-0.3-beta15
$ ./configure
$ make
$ sudo make install

Install hard disk temperature database at /usr/share/misc or /etc directory:
$ cd /usr/share/misc
# wget

Monitor Hard Disks Temperature With hddtemp

Let us see usage, syntax and examples of hddtemp command. The syntax is
hddtemp disk
hddtemp TYPE:disk
hddtemp [options] TYPE:disk

TYPE could be SATA, PATA or SCSI. If omitted hddtemp will try to guess

How do I monitor hard disk temperature on Linux?

To see temperature for the /dev/sda, enter the following command:
$ hddtemp /dev/sda
Sample outputs

/dev/sda: WDC WD2500YS-01SHB1:  25°C

Above output indicate that my hard disk temperature is 25°C. If temperature is higher than 60°C , consider cooling options immediately.

How Do I Find Out Remote Server HDD Temperature?

By default hddtemp bind to TCP/IP port 7634. You need to run hddtemp in daemon mode. Login on remote box and start it as follows to monitor /dev/sda, /dev/sdb, /dev/sdc, and /dev/sdd:
# hddtemp -d /dev/sd[abcd]
Use telnet or nc / netcat command to to get a temperature from a remote box:
$ telnet remotebox 7634
$ nc 7634
Sample outputs:

|/dev/sda|Samsung SSD 850 EVO mSATA 500GB|45|C|

You can format it as follows using the awk command:
nc centos7-box 7634 | awk -F'|' '{print $2 " " $4 $5 "(" $3 ")"}'
Sample outputs:

/dev/sda 45C(Samsung SSD 850 EVO mSATA 500GB)

Shutdown Linux Computer If Temperature >= 55

To power off / shutdown computer, run following command via cron tab (cron job) file:
t=$(hddtemp /dev/sda --numeric)
[ $t -ge 55 ] && /sbin/shutdown -h 0

Sample shell script to shutdown box if temperature >= 55°C (download link):

# Purpose: Shutdown server if disk temp crossed $ALERT_LEVEL
# Author: Vivek Gite {}, under GPL v.2.x
# -----------------------------------------------------------------
HDDS="/dev/sda /dev/sdb /dev/sdc /dev/sdc /dev/sdd /dev/sde"
for disk in $HDDS
  if [ -b $disk ]; then
        HDTEMP=$( ${HDT} --numeric ${disk} )
        if [ $HDTEMP -ge $ALERT_LEVEL ];
           $LOG "System going down as hard disk \"$disk\" temperature ($HDTEMP) crossed its limit."
           $DOWN -h 0

You can run script using a cron job on Linux or Unix-like system:
$ sudo crontab -e
Append the following to run cron job every 10 minutes to check for disk temp:
*/10 * * * * /root/bin/chk-disk-temp.bash

hddtemp command options

To see usage, run:
$ hddtemp --help
Sample outputs:

  -b   --drivebase   :  display database file content that allow hddtemp to
                        recognize supported drives.
  -D   --debug       :  display various S.M.A.R.T. fields and their values.
                        Useful to find a value that seems to match the
                        temperature and/or to send me a report.
                        (done for every drive supplied).
  -d   --daemon      :  run hddtemp in TCP/IP daemon mode (port 7634 by default.)
  -f   --file=FILE   :  specify database file to use.
  -F   --foreground  :  don't daemonize, stay in foreground.
  -l   --listen=addr :  listen on a specific interface (in TCP/IP daemon mode).
  -n   --numeric     :  print only the temperature.
  -p   --port=#      :  port to listen to (in TCP/IP daemon mode).
  -s   --separator=C :  separator to use between fields (in TCP/IP daemon mode).
  -S   --syslog=s    :  log temperature to syslog every s seconds.
  -u   --unit=[C|F]  :  force output temperature either in Celsius or Fahrenheit.
  -q   --quiet       :  do not check if the drive is supported.
  -v   --version     :  display hddtemp version number.
  -w   --wake-up     :  wake-up the drive if need.
  -4                 :  listen on IPv4 sockets only.
  -6                 :  listen on IPv6 sockets only.

A note about nvme ssd

We can use the smartcl or nvme command to get temperature. For instance:
sudo smartctl -A /dev/nvme0

smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.18.0-25-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke,
SMART/Health Information (NVMe Log 0x02, NSID 0xffffffff)
Critical Warning:                   0x00
Temperature:                        41 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    0%
Data Units Read:                    15,889 [8.13 GB]
Data Units Written:                 80,845 [41.3 GB]
Host Read Commands:                 256,531
Host Write Commands:                553,980
Controller Busy Time:               3
Power Cycles:                       38
Power On Hours:                     4
Unsafe Shutdowns:                   27
Media and Data Integrity Errors:    0
Error Information Log Entries:      41
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0
Temperature Sensor 1:               41 Celsius
Temperature Sensor 2:               45 Celsius

Another option is to try out nvme command to read nvme ssd temperature as folloows:
sudo nvme smart-log /dev/nvme0
Here is what I saw:

Smart Log for NVME device:nvme0 namespace-id:ffffffff
critical_warning                    : 0
temperature                         : 41 C
available_spare                     : 100%
available_spare_threshold           : 10%
percentage_used                     : 0%
data_units_read                     : 15,889
data_units_written                  : 80,841
host_read_commands                  : 2,56,531
host_write_commands                 : 5,53,822
controller_busy_time                : 3
power_cycles                        : 38
power_on_hours                      : 4
unsafe_shutdowns                    : 27
media_errors                        : 0
num_err_log_entries                 : 41
Warning Temperature Time            : 0
Critical Composite Temperature Time : 0
Temperature Sensor 1                : 41 C
Temperature Sensor 2                : 45 C
Thermal Management T1 Trans Count   : 0
Thermal Management T2 Trans Count   : 0
Thermal Management T1 Total Time    : 0
Thermal Management T2 Total Time    : 0

See “Linux find NVMe SSD temperature using command line” for more info.

Say hello to smartctl Utility

If you have smartctl utility installed, try it as follows to get temperature data:
# smartctl -d ata -A /dev/sda | grep -i temperature
# smartctl -A /dev/sdb | grep -i temperature

Linux Find Hard Disk Temperature Command
Set ALERT_LEVEL as per your requirements. Please refer to your hard disk manual for working temperature guideline. Here is general temperature guideline (extracted from Seagate SV35.2 Series Hard Drives Web Page):

Operating 0 to 60 degrees C
Nonoperating -40 to 70 degrees C
Maximum operating temperature change 20 degrees C per hour
Maximum nonoperating temperature change 30 degrees C per hour
Maximum operating case temperature 69 degrees C

Gnome GUI based disks & storage tool

Type the following command:
Click on the Disk and it will show you disk temperature as follows:
Monitor Hard Disks Temperature With hddtemp and Gnome Disks

A note for MS-Windows XP / Vista/ 7 / 10 / Server Users

Sorry. The hddtemp is UNIX / Linux only program.


You learned how to monitor hard disks temperature with hddtemp, smartctl and GUI tool. For more information see:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 31 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
31 comments… add one
  • Mace Moneta Oct 9, 2007 @ 11:08

    35C is a little premature to be shutting down the system, or even to get additional cooling. Most manufacturers specify a maximum operating temperature of 60C as being fully within specifications. Check your drive manufacturer’s web site for the specifications for your particular drive. During periods of high activity (e.g., backups, RAID sync), a drive can easily exceed 50C. Shutting down every time that happens is not productive.

  • 🐧 nixCraft Oct 9, 2007 @ 11:40


    I agree with you. 35C is just for example. You can set ALERT_LEVEL as per your requirements or just send an email. The post has been updated to reflect your views.

    Appreciate your post!

  • the polarizer Oct 9, 2007 @ 21:52

    Neat little howto. Instant success

    box@ubuntu:~$ sudo hddtemp /dev/sda
    /dev/sda: SAMSUNG SPXXXX: 33°C
    box@ubuntu:~$ sudo hddtemp /dev/sdb
    /dev/sdb: SAMSUNG SPXXXX: 32°C

    Here on my striped raid.

    I would welcome a warning instead of immediate box shutdown w/o named reason. Some speaker beeps would fulfill that approach.

    the polarizer

    PS: Have to check whether the sda drive which is more hot is on the top.

  • Sweta Oct 10, 2007 @ 12:33


    Nice program. I’m gonna try out hddtemp for windows xp sp2.



  • marxjo Oct 11, 2007 @ 0:04

    For example. Seagate disks work normally even at 50C, but if such temp will last longer, Seagate drives will start to squel, but if you have a server room…

  • I_LOVE_Missouri Oct 13, 2007 @ 12:37

    I personally think that you are the best Linux blogger that I’ve ever seen. I read your blog all the time and I think it’s so well done. My browser home page set to!

  • 🐧 nixCraft Oct 13, 2007 @ 13:03

    Thanks for the feedback! You made my day 😀

  • Pragadeshv Nov 20, 2007 @ 13:41

    Its Really use full for me. Thanks vivek.

  • pete Jan 9, 2008 @ 9:30

    this program has an error with my version of hddtemp.
    $4 should read $3
    ‘ should read ‘
    so the line should be:
    HDTEMP=$($HDT $disk | awk ‘{ print $3}’ | awk -F ‘°’ ‘{ print $1}’)

    additionally, if a shutdown is to occur, and there is more than one hard drive, the shutdown command will be executed for the number of hard drives that exceed the temperature. i am a linux newbie and don’t know if this is relevant.

  • Erwin Sep 11, 2008 @ 8:06

    Check hddtemp-0.3-beta15/src/hddtemp.c
    on line 227, the hddtemp tool can also print out just the temperature value. No need to parse the output and fetch the value from a formatted string.
    Just issue this command:

    /usr/local/sbin/hddtemp /dev/hdc --numeric

  • Erwin Kooi Sep 11, 2008 @ 8:13

    This is my cron script using the –numeric arg:

    for disk in $HDDS
    if [ -b $disk ]; then
    HDTEMP=$($HDT $disk $args)
    $LOG "HDTEMP for $disk is $HDTEMP"
    if [ $HDTEMP -ge $ALERT_LEVEL ]; then
    $LOG "System going down as hard disk : $disk temperature $HDTEMP exceeded its limit"
    $DOWN -h 0

    • FErArg Nov 6, 2013 @ 13:45

      Great Contribution!


  • andrew Nov 15, 2008 @ 21:47

    My Drive is named: SAMSUNG HD400LJ
    and behaves normally, 194 is allright 🙂
    Thanks for this great software!

  • Brian Feb 15, 2009 @ 9:13

    Thank you, just what i need fore my server in my closet 🙂

    But i think i will make it beep fist and if the temperature raises further then shutdown.

  • JAY May 31, 2009 @ 22:21

    HDT=”/usr/sbin/hddtemp -n”

  • JAY May 31, 2009 @ 22:24
    for disk in $HDDS
      if [ -b $disk ]; then
    	HDTEMP=$($HDT $disk)
            if [ $HDTEMP -ge $ALERT_LEVEL ]; then
    		date >> ~/Desktop/ERRORS.TXT
               	echo "System going down as hard disk : $disk temperature is $HDTEMP°C" >> ~/Desktop/ERRORS.TXT
    		$DOWN -h 0
    		echo $disk - $HDTEMP
    	if [ $HDTEMP -ge $WARN_LEVEL ]; then
    		date >> ~/Desktop/ERRORS.TXT
               	echo "hard disk : $disk temperature is $HDTEMP°C" >> ~/Desktop/ERRORS.TXT
    		/usr/bin/notify-send -u critical -c device.error -i /usr/share/icons/Human/32x32/status/dialog-warning.png -t 900 "HDD TEMP" "$disk temperature $HDTEMP°C"
    		zenity --info --text "hard disk : $disk temperature $HDTEMP°C"
    exit 0
  • steveh Jul 22, 2009 @ 13:15

    To see temperature for /dev/sda, enter the following command:
    # hddtemp /dev/sda

    /dev/sdb: WDC WD2500YS-01SHB1: 25°C

    The output should also be /dev/sda not sdb.

    • Philippe Petrinko Jul 7, 2010 @ 12:57

      Hi Vivek,

      SteveH is right there is a typo (should be the same device ! sda )

      And Andrey ask a useful question: Is it possible to get any SMART HDD info using a HDD-USB drive ?


      • 🐧 nixCraft Jul 7, 2010 @ 20:42


        I’ve updated the post. And yes, it works with hdd info using a USB drive directly connected to system or via docking station.


  • Andrey Mar 28, 2010 @ 7:09

    Thanks for your blog!
    Tell me please, will it work for me if I use the SATA Docking Station, so the hard drive is connected to my computer via usb?
    What am I supposed to do?

    • 🐧 nixCraft Jul 7, 2010 @ 20:40

      Yes, it works with laptop docking station connected via USB.

      hddtemp sata:/dev/sdc
  • Luc Jul 13, 2010 @ 14:10


    First off, thanks for the great tutorial and information.

    I have a question. How does this work with RAID drives, or can it? For example, all of my servers are running either RAID-0,2,6, etc and usually all the drives show up as one in linux (ex: /dev/sda).

    I have not tried this method yet, but I’m wondering if and how this would work with RAID (where a raid controller connects the drives to the system).


    • 🐧 nixCraft Jul 13, 2010 @ 14:29

      Most modern RAID controller expose themself to you via different device name under Linux. See this FAQ. Also cli tools provided by RAID controller can be used to obtain the same info. It all depends upon your RAID card. However, hddtemp may not work for RAID based hard disk, use smartctl command:

      smartctl -d scsi --all /dev/sg1  | grep -i temp
      Temperature Warning Disabled or Not Supported
      Current Drive Temperature:     23 C
      Drive Trip Temperature:        65 C

      This is from Adaptec 5405 SAS running FUJITSU hard disks.

  • Aario Nov 23, 2010 @ 21:51

    Mine is 59C! It’s too hot. You said cooling options, please someone tell me how can I cool down my hard drive?
    Laptop: Acer Aspire 5536
    Linux: Ubuntu 10.04
    Here’s the output of hddtemp command:
    sudo hddtemp /dev/sda
    /dev/sda: WDC WD3200BEVT-22ZCT0: 59°C
    Thanks in advance.

    • Erik Dec 26, 2010 @ 19:15

      You can put a small fan in front of the drives ( in the front of your comp-case ). this well draw fresh (cool) air in and blow it over the Harddisk and cooling it. Also, place your computer on the floor ( the air is cooler on the floor )

      I am having this problem : I use hddtemp (daemon) in combination with conky. My 4 internal drives report just fine, but my 2 external sata-drives connected with usb don’t report the temperature ( -> N/A in conky ). The internal and external drives are all Samsung model 103SJ / SI or UJ. ( i tried putting sata: in front of the device name in the conky config file. When i try hddtemp in terminal ‘hddtemp /dev/sbb’ i get ‘/dev/sdb: SAMSUNG HD103SI: S.M.A.R.T. not available’, when i try ‘hddtemp sata:/dev/sdb’ i get a several lines of weird characters and the correct temperature behind them)
      Any suggestions how to fix this ?

  • pr7vinas Jan 27, 2011 @ 13:53

    I do not recommend hddtemp. My application fails because of it.
    I run it about 30 times and in the middle, it fails. It causes an error on the bus. I’m looking for something better.

  • mark Sep 26, 2011 @ 16:01

    Not working on USB drives

    hddtemp /dev/sde
    /dev/sde: WD Ext HDD 1021: S.M.A.R.T. not available

    • Melody Sep 26, 2014 @ 7:25

      sudo smartctl -d auto -A /dev/sdb | grep -i temperature

      where sdb is an external usb drive (this was a usb 3.0 connection)

  • d4m1r Aug 2, 2012 @ 0:31

    Created the below script in a file (called check-hddtemp) in /usr/local/sbin/ and set it to run every 30min in my Ubuntu Server 11.10’s crontab file (in /etc/). Script is below and so is more information how to set it up.

    for disk in $HDDS
    if [ -b $disk ]; then
    HDTEMP=$($HDT $disk $args)
    $LOG "HDTEMP for $disk is $HDTEMP"
    if [ $HDTEMP -ge $ALERT_LEVEL ]; then
    $LOG "System going down due hard disk : $disk temperature $HDTEMP exceeded its limit"
    $DOWN -h 0

  • Piotr Opara May 20, 2013 @ 8:59

    Insted of:
    HDTEMP=$($HDT $disk | awk ‘{ print $4}’ | awk -F ‘°’ ‘{ print $1}’)
    try use
    HDTEMP=$($HDT -n $disk | awk ‘{ print $1}’)

  • Rafal Nov 18, 2014 @ 2:59

    For Windows users, you can download smartmontools for Windows (free) instead of using a trial version of hddtemp. Then create check.bat to check the temp and if it reaches the max level, use the shutdown command plus some echo command to a log file.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum