Hddetemp vs hddtemp

Sep 17, 2022 Last reply: 3 years ago 12 Replies

Hi everyone,



maybe this info is helpful for someone:



With "hddtemp" there's a tool out, capable of monitoring harddisks' temperature. This may help to prevent them from heat death.



Unfortunately, hddtemp (every version I know of) can only access internal drives. External ones can not be read. Don't know why.



So, I developed a little workaround and called it hddetemp (e for external, also). It is now also tested under Raspbian OS.



Here you see the difference:



[542 root@rpi-inst /]# hddtemp /dev/sda /dev/sda: Generic External: S.M.A.R.T. not available
[543 root@rpi-inst /]# hddetemp /dev/sda /dev/sda: Hitachi HTS545016B9A300: 25 (Min/Max 16/43)°C

If you find this helpful, you can get it from here:



formatting link
Best regards,



Markus



On a sunny day (Sat, 17 Sep 2022 17:20:51 -0000 (UTC)) it happened Markus Robert Kessler <no snipped-for-privacy@dipl-ing-kessler.de wrote in <tg4vlj$77k3$ snipped-for-privacy@dont-email.me:

There is the main HD info program hdparm man hdparm

# hdparm -H /dev/sdb /dev/sdb: drive temperature (celsius) is: under -20 drive temperature in range: yes

That is with my external 3 TB Toshiba drive Not sure 'under -20' makes any sense.

I tried your code, installed 'smartctl':

# hddetemp /dev/sdb /dev/sdb: TOSHIBA MQ04UBB400: °C

So.. may work for some drives.....

Am Samstag, 17. September 2022, um 17:20:51 Uhr schrieb Markus Robert Kessler:

Great, but wouldn't it be the best solution to implement your extensions into hddtemp? Did you contact the original developer about this?

smartctl of smartmontools, knows the temperature. It looks at location 190 and 194, depending on drive type. Some devices will require smart passthru, to gain access.

suso smartctl --all /dev/sda | grep -i temperature # basic idea, remove the grep and review by hand

And gnome-disks seems to as well, got both drives (local sata, USB SSD), It would be interesting to see what cluster of utilities gnome-disks uses. This is my go-to tool for daily usage.

inxi -F seems a bit lame in the temperature department, getting one of two drives.

The hardware has all sorts of quirks, so this is a topic for individuals with the time to spend on it.

Paul

Hi Marco,

implementing this code into hddtemp source would be nice, but looking at

formatting link
(official homepage) it seems that hddtemp is no longer maintained. Updating the drives database is not enough to get ahead here.

Thanks, best regards,

Markus

Hi Jan,

could you please paste smartctl's output for your drive, section "Vendor Specific SMART Attributes with Thresholds:", like

ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE [...]

190 Airflow_Temperature_Cel 0x0032 068 049 000 Old_age Always - 32 [...]

Thanks!

Best regards,

Markus

Is Hddtemp just a spinning drive-type tool or is it applicable for Solid State Drives as well??

Am Sonntag, 18. September 2022, um 23:09:24 Uhr schrieb Daniel65:

Why should that matter? There is a temperature sensor that need to be read out, regardless of the technology the disk uses. But according to the other post hddtemp is very old, so it is from a time where SSD weren't common.

What works for me (on SSD):

nvme smart-log /dev/nvme0 | grep temperature

from "man nvme" ;

<quote>

NVME(1) NVMe Manual NVME(1)

NAME nvme - the NVMe storage command line interface utility (nvme-cli)

SYNOPSIS built-in plugin:

nvme <command> <device> [<args>] </quote>

For reasons that escape pretty well everyone, the SMART table on legacy HDD and on the new SSD, don't match. You would think there would be value, having entries with the same name, at their traditional address. I would guess that is too easy.

Some environment information is pinned out in ACPI tables, such as CoreTemp from your CPU. One of the improvements in reading the hardware monitor interface on the SuperIO, was for the BIOS to wrap some of the information, making it easier for userland applications to "consume" the information. For example, the scaling resistors on the voltage measurement section, if you use the ACPI table, the voltages are already scaled for you. And that saves an unbelievable amount of labor. In the past, humans used to submit empirically derived scale resistor info, to the maintainer of MBM5, per motherboard design. And that sucked as a method. Having the correct values computed by the BIOS designer, and passed via ACPI table, made so much more sense.

But not everything in life is that easy. Thus, we're still fiddling with SMART tables in the year 2022.

I assume NVMe temperature is the same as SATA SSD, but that would be a rash assumption unless verified. Even an eMMC chip, could have its temperature information, delivered in some other way. And USB flash sticks, I've never seen a measured value printed on a screen, for those.

Paul

Am Sat, 17 Sep 2022 17:20:51 -0000 (UTC) schrieb Markus Robert Kessler <no snipped-for-privacy@dipl-ing-kessler.de:

Are there any plans to provide deb packages and/or include this software in the official repositories of Debian/Ubuntu?

Then more people will likely use it.

Tried it on a system with and external drive inside a usb converter, and the systemctl command simply hangs. ^C cannot free it, but sudo killall hddetemp did kill it.

If you look into the source, you see that hddetemp has nothing to do with systemctl. It relies on smartctl. If this hangs, then something is wrong with your hardware.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required