Temperature of drives

Hello all. Does anyone know of a way to get the temperature of external USB drives in Ubuntu Desktop?

GUI or CLI.

Or better still, have something monitor them.

This is what I use in windows

Found something…

try this site

Linux Monitor Hard Disks Temperature With hddtemp - nixCraft (cyberciti.biz)

Well it may be my lack of Linux knowledge but:
sudo apt-get install hddtemp

returned this

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package hddtemp is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'hddtemp' has no installation candidate

Try installing smartmontools, if it is not yet installed by default. I guess, there is also gsmartcontrol that provided GUI interface to the first one (CLI only). It may be challenging at first to use (CLI), but most likely that is the best tool for SMART data.

sudo apt-get install smartmontools -y
sudo update-smart-drivedb

sudo smartctl -a /dev/sd[x] | grep Temperature
[x] is ur hdd

1 Like

Smart controls doenst work either (ive enabled smart coneol for this drive)

Smartctl open device: /dev/sdf [SAT] failed: Permission denied

Just about to try GSmartControl (https://gsmartcontrol.shaduri.dev/)

Which works but its a lot of clicking to get the temperature of a single drive. I was hoping there was something that listed all drives and temperatures and emailed me if one got too high

u must use “sudo” befor the comand

Wonder why it did’t work?

Before you start using it from, run smartctl --scan as that will give you the interface that (may be needed) to check a given drive.

The “–scan” runs through all possible interfaces for each drive. When you just target a given drive, only the default interface is used, so it may be a hit or miss (especially for USB drives).

By the way, I have never used / seen that GUI interface, so cannot comment on that. CLI version is good enough for me (have never failed).

By the way, you can also install it on Win to get your feet wet, if that is an easier way to test it for you. It also requires an elevated access on Windows.

Also, this is your guide - smartctl(8) - Linux man page

1 Like

He did use sudo apt-get install hddtemp

not with this

20 characters …

Just finished installing a ubuntu guest in vmware workstation and I also tried to install this.


So I wrote them an email to see what they have to say. @Jacek I thought I gave up this command line stuff in 2016?

Hey its from March 7, 2022

I have never migrated to Linux GUI stuff. :slight_smile:

Try “sudo smartctl --scan” to see whether it is installed by default. (Although, I think --scan may not require elevation, as it only checks the protocol used.)

sudo: smartctl: command not found

Yeah, then follow what @amarena posted above to get it installed.


So now my drive is frozen since its in a VMguest :joy: :joy:

try
sudo smartctl -a /dev/sd[x] | grep 194 Temperature

or just

sudo smartctl -a /dev/sd[x]

and search for the correct data

could also be a problem with the VM bridge for sata


Could be since its in its own shell it cant talk with the harware. I dont want to install linux on its own box :woozy_face: :woozy_face: :woozy_face:

smartctl works with drives, not with partitions, so drop that partition number, and try again.

Actually, start with the --scan option.

[root@camel ~]# smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device

That gave me two drives, and ‘scsi’ protocol to connect. Although, I think scsi is the default one, so we can omit it (when used it gives problems). Using the first drive, lets check what it is, and whether is SMART is supported:

[root@camel ~]# smartctl  -i /dev/sda
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-957.27.2.el7.x86_64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Samsung based SSDs
Device Model:     Samsung SSD 840 PRO Series
Serial Number:    S1ANNEAD643618B
LU WWN Device Id: 5 002538 5503ba793
Firmware Version: DXM05B0Q
User Capacity:    128,035,676,160 bytes [128 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4c
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Sun Jul 10 18:10:40 2022 PDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

OK, SMART is on, let’s grab it:

[root@camel ~]# smartctl  -A /dev/sda
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-957.27.2.el7.x86_64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   087   087   000    Old_age   Always       -       64164
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       114
177 Wear_Leveling_Count     0x0013   093   093   000    Pre-fail  Always       -       243
179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0
181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0
182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0
183 Runtime_Bad_Block       0x0013   100   100   010    Pre-fail  Always       -       0
187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0032   062   060   000    Old_age   Always       -       38
195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0
199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0
235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       34
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       9173359224

So, we got the SMART table, and as @amarena posted, can add grep to that line above.

[root@camel ~]# smartctl  -A /dev/sda | grep Temperature
190 Airflow_Temperature_Cel 0x0032   062   060   000    Old_age   Always       -       38

I have seen on newer drives that there are multiple entries for temps, so check that table first. Although, it may be that attrib 190 is the standard one for main temp. Also, some higher ones (above 200? not sure) may be vendor specific.

Although, I also have USB 18TB WD Easystore, and somehow smartctl doesn’t bite it on this box. I have the same model on my Win harvester, and can query that drive there.

Well you made me doit, found another box outside install linux


And there is the temperature setting… :joy: :joy: :joy:

I hope its the 49 on the right

2 Likes