How to add a hard disk to hddtemp and read the temperature

http://commons.wikimedia.org/wiki/File:Crystal_128_harddrive.pngHddtemp is an application for reading the temperature sensor of hard disks with S.M.A.R.T support. In case the software doesn’t recognize your hard disks sensor, but you are sure that your disk has one and is also S.M.A.R.T enabled, you can manually add the correct parameters for your disk to the hddtemp database. I will show this based on my INTEL 530 Series mSATA Solid-State drive in the second part of this post, .

 

1. Reading the hard disks temperature with hddtemp

To read temperature of a S.M.A.R.T enabled hard disk with hddtemp use the following command:

$ sudo hddtemp /dev/sdX

Replace sdX with the name of your device. I used sdb.
 

2. Adding unsupported hard disks to hddtemp

  • If your hard disk is not yet supported, you will see a message like this when trying to read the temperature:
    $ sudo hddtemp /dev/sdb
    WARNING: Drive /dev/sdb doesn't seem to have a temperature sensor.
    WARNING: This doesn't mean it hasn't got one.
    WARNING: If you are sure it has one, please contact me (hddtemp@guzu.net).
    WARNING: See --help, --debug and --drivebase options.
    /dev/sdb: INTEL SSDMCEAW240A4:  no sensor
    

  • In case you are sure that you have a S.M.A.R.T enabled device with a temperature sensor, you can try to find the field containing the temp value by executing this command:
    $ hddtemp --debug /dev/sdX

    Again, you have to replace sdX with the name of your device. In my case that's sdb and the output looks like this:

    $ hddtemp --debug /dev/sdb
    
    ================= hddtemp 0.3-beta15 ==================
    Model: INTEL SSDMCEAW240A4
    
    field(5)	 = 0
    field(9)	 = 41
    field(12)	 = 12
    field(170)	 = 0
    field(171)	 = 0
    field(172)	 = 0
    field(174)	 = 0
    field(183)	 = 9
    field(184)	 = 0
    field(187)	 = 0
    field(190)	 = 44
    field(192)	 = 0
    field(199)	 = 0
    field(225)	 = 87
    field(226)	 = 255
    field(227)	 = 49
    field(228)	 = 255
    field(232)	 = 0
    field(233)	 = 0
    field(241)	 = 87
    field(242)	 = 16
    field(249)	 = 0
    
    If one of the field value seems to match the temperature, be sure to read 
    the hddtemp man page before sending a report (section REPORT). Thanks.

    For my SSD it seems like field 190 contains the temperature value in Celsius. In case you are not sure, try to make some traffic on the device so it heats up and keep monitoring the field values. When you have found the right field value write it down somewhere. In the next step we will add our hard disk to the database file of hddtemp.

  • Open the hddtemp database file "hddtemp.db". Depending on your system, this file can be located in different places. The most common are: /etc/ , /etc/default/ , /usr/share/hddtemp/
     
  • Add a new line at the end of the file. The first entry is a regular expression that allows hddtemp to recognize our drive. I used the model-name from the debug output "INTEL SSDMCEAW240A4". The second expression is the field id we found in the debug output, for me that's 190. The third attribute is the unit of the temperature value, either C for Celsius or F for Fahrenheit. The last attribute is a comment, you can choose whatever you want. In conclusion my entry at the end of hddtemp.db looks like this:
    ########################################
    ############# My Intel SSD
    ########################################
    "INTEL SSDMCEAW240A4"   190     C       "INTEL SSD 530 Series mSATA"
    

  • Save and close the file and try to read the temperature again. It should work this time. The output should look like this:
    $ hddtemp  /dev/sdb
    /dev/sdb: INTEL SSDMCEAW240A4: 45°C

    In case everything worked, you can send your configuration for the device to the developer of hddtemp. He will add it to the database file. You can find his Mail-Address by typing hddtemp --help in the terminal.

Legal notice: image from wikimedia, released under the GNU Lesser General Public License

About M0nk3ym0nk3y

M0nk3ym0nk3y is one of the three LinuxM0nk3ys from Linux M0nk3ys @ WordPress Linux M0nk3ys @ YouTube Linux M0nk3ys @ Twitter

Posted on September 30, 2014, in Command-Line, Configure, Troubleshooting and tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink. Leave a comment.

Leave a comment