30

I have used of hdparm -n and smartctl -A but it always seem to be a "per drive" technique as a drive may answer for only one of these tools.

So, is there a standard way to get the drive temperature on Linux (HDD or SSD)? If not, what (other) tools can I use to get this information?

37

I like hddtemp, which provides a pretty standard way of getting the temperature for supported devices. It requires SMART support though.

Example Usage: sudo hddtemp /dev/sd[abcdefghi]

Example Response:

/dev/sda: WDC WD6401AALS-00J7B0: 31°C
/dev/sdb: WDC WD7501AALS-00J7B0: 30°C

  • 2
    Listing many drives at once can be done with hddtemp /dev/sd{a,b,c,d,e,f,g,h,i} . – Xdg Dec 16 '15 at 10:44
  • 4
    A shorter way would be hddtemp /dev/sd?. – Rovanion Jun 28 '16 at 22:39
  • 1
    hddtemp /dev/sd[abcdefghi] also works and spares your fingers a bit. – Serge Stroobandt Nov 13 '16 at 20:59
  • There is no hddtemp neither yum install hddtemp in CentOS 7. – Pro Backup Dec 16 '16 at 10:20
  • 1
    /dev/sd? spares even more fingers. – kkm Jan 2 '18 at 22:35
6

All SMART-capable devices should respond to smartctl. And I guss that only smart-devices have a temperature reading.

All other tools will propably be more or less vendor-specific (like Dell`s omsa). IPMI might be another generic approach, but I doubt, that a temperature-reading of a storage-device is standard there.

2

As mentioned by Rovanion, to list all drives in one go:

hddtemp /dev/sd?

Or, if you prefer a for loop:

for i in /dev/sd[a-z]; do hddtemp "$i"; done
  • 1
    Don't loop over ls. This is the correct way: for i in /dev/sd[a-z]; do hddtemp "$i"; done – Dennis Williamson May 8 '18 at 21:34
0

You might want to try watch "sensors && sudo hddtemp /dev/sd?" which provides cpu and other temperature information in addition.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.