(03-14-2021, 05:38 PM)kuleszdl Wrote: @Neo2018 One way to accomplish this is:
Code:smartctl --all /dev/sda|grep -i temp
Not sure if there is a "smarter" way to extract just the single value.
I don't know if that's what you're looking for or what is meant, but that's what I found out:
at hddtemp the standard output is:
Code:
/dev/sda: ST1********08-***03: drive is sleeping
The temperature is only displayed when the hard disk/hdd is in use:
Code:
/dev/sda: ST1********08-***03: 40°C
Therefore you can ignore the output of hddtemp!
There is still hdparm, but here too the output is confusing.
- output: /dev/sda: drive state is: active/idle > means that the HDD is in active work!
- output: /dev/sda: drive state is: unknown > means that the HDD is working or waiting, idling!
- output: /dev/sda: drive state is: standby > means that the HDD is asleep or in standby!
The good thing is that if the HDD is in standby/sleeps, they are not activated, because, for example, when you query with smartctl --all /dev/sda | grep -i temp, the HDD is brought out of standby/sleepy.
Code:
$ 'date' && sudo hddtemp /dev/sda && sudo hddtemp /dev/sdc && sudo hddtemp /dev/sdb && sudo hdparm -C /dev/sda && sudo hdparm -C /dev/sdc && sudo hdparm -C /dev/sdb
Mo 15. Mär 10:14:17 CET 2021
/dev/sda: ST10000VN0008-2PJ103: drive is sleeping
/dev/sdc: ST8000VN0022-2EL112: drive is sleeping
/dev/sdb: WDC WD5000LUCT-63RC2Y0: 39°C
/dev/sda:
drive state is: unknown
/dev/sdc:
drive state is: standby
/dev/sdb:
drive state is: active/idle
Code:
$ sudo smartctl --all /dev/sda|grep -i temp
190 Airflow_Temperature_Cel 0x0022 061 049 040 Old_age Always - 39 (Min/Max 30/45)
194 Temperature_Celsius 0x0022 039 045 000 Old_age Always - 39 (0 22 0 0 0)
maybe help to understand that