Confused about SMART info and HDD temps

akovano

Cadet
Joined
Feb 10, 2022
Messages
3
I know I can check hdd temp by running
Code:
smartctl -a /dev/da[x]

but I am unclear if this is pulling the current temperature value, or if this is the disk temperature when a SMART test was last run?

I wanted to keep an eye on my disk temperatures as the ventilation around my rack is not ideal.
I have SMART test (short) scheduled to run once a week, so I wasn't clear if smartctl was looking at the result of the previous test or pulling the current temperature value.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
It's whatever the drive manufacturer decided to do. Generally it represents some sort of "current" temperature, but who knows how often it is updated.
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
check it with a -a then run the short test "-t short" will take 1 or 2 minutes, then check it again.
 

akovano

Cadet
Joined
Feb 10, 2022
Messages
3
Thanks, I tried this for one of the drives and got the same temp result.

So when "smartctl" is run, is this actually querying the drive directly for a result (which may or may not be current depending on the manufacturer)?

Or is this command getting the result from a previous test result (stored in TrueNAS)?

Basically I'm trying to figure out if I need to run a SMART test every time I want to check the temperatures, or if I can have a script that greps the result from smartctl for each drive every so often and that will give a somewhat current result.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
o when "smartctl" is run, is this actually querying the drive directly for a result

smartctl is interactively chatting with the drives. What that conversation consists of may be gibberish on the HDD's side, and a bunch of very clever people have put a lot of effort into smartctl over the years to try to decipher it and make it usable and at least somewhat useful.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Basically I'm trying to figure out if I need to run a SMART test every time I want to check the temperatures
That is definitely not the expectation.
or if I can have a script that greps the result from smartctl for each drive every so often and that will give a somewhat current result.
Yeah, that's more in line with disks seem to do. I say "seem" because they can be rather opaque (to say nothing of outright lies).
 

akovano

Cadet
Joined
Feb 10, 2022
Messages
3
OK understood thanks.
FWIW, I just ran a test on this. Opened up the case and blew a steady stream of air across the drives for 5-10 minutes.
Without running a SMART test, I kept checking the results of smartctl and after a couple minutes a saw a slight drop in temp. So it does pull somewhat current values. Good to know.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
The -x option should also include a time-series of temperature values recorded by the disk, which is occasionally useful to understand patterns.
 
Top