Novena Laptop Linux Samsung 840 EVO Hard Drive Temperature Sensor Fix

The Novena laptop’s Linux build doesn’t support the Samsung 840 EVO hard drive that it ships with. While this isn’t a problem specific to the Novena by any means, it will affect the users. It’s a simple fix, just edit the hddtemp.db file and add the proper ID string and temp code to it. You can just echo-append it, or if you are fussy open it in an editor and put it neatly in the Samsung section!

[bash]
echo ‘"Samsung SSD 840 EVO 250G B" 190 C "Samsung SSD 840 EVO 250GB"’ >> /etc/hddtemp.db
^—that space needs to be there; see below
[/bash]

If you want to find how to add this to hddtemp.db yourself, or on a different model drive that’s not in the db file, use smartctl and hddtemp --debug. The -A flag on smartctl lists the drive’s attributes. Look for the ID# for the temperature sensor. It also may indicate Celsius or Fahrenheit, but more likely it will be Celcius. Here we can see it’s attribute number 190, and based on the name, it’s in Celsius.

[text]
root@novena:~# smartctl -A /dev/sda
smartctl 6.4 2014-10-07 r4002 [armv7l-linux-3.19.0-00268-g04e9d08] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always – 0
9 Power_On_Hours 0x0032 099 099 000 Old_age Always – 169
12 Power_Cycle_Count 0x0032 099 099 000 Old_age Always – 12
177 Wear_Leveling_Count 0x0013 100 100 000 Pre-fail Always – 0
179 Used_Rsvd_Blk_Cnt_Tot 0x0013 100 100 010 Pre-fail Always – 0
181 Program_Fail_Cnt_Total 0x0032 100 100 010 Old_age Always – 0
182 Erase_Fail_Count_Total 0x0032 100 100 010 Old_age Always – 0
183 Runtime_Bad_Block 0x0013 100 100 010 Pre-fail Always – 0
187 Uncorrectable_Error_Cnt 0x0032 100 100 000 Old_age Always – 0
190 Airflow_Temperature_Cel 0x0032 067 064 000 Old_age Always – 33
195 ECC_Error_Rate 0x001a 200 200 000 Old_age Always – 0
199 CRC_Error_Count 0x003e 100 100 000 Old_age Always – 0
235 POR_Recovery_Count 0x0012 099 099 000 Old_age Always – 8
241 Total_LBAs_Written 0x0032 099 099 000 Old_age Always – 39490266
[/text]

You can get the drive’s name with hddtemp --debug and also make an educated guess as to the sensor ID#. Notice the space in “250G B” below – you’ll want to use this exact model string in the db file. Not sure precisely why that space should be there, but from the hddtemp source it seems that’s how the drive identifies itself via SATA command. Perhaps other utils like smartctl get the name in other ways, or fix it up. I don’t have time to dig further on that…

[text]
root@novena:~# hddtemp –debug /dev/sda

================= hddtemp 0.3-beta15 ==================
Model: Samsung SSD 840 EVO 250G B �@

field(5) = 0
field(9) = 170
field(12) = 12
field(177) = 0
field(179) = 0
field(181) = 0
field(182) = 0
field(183) = 0
field(187) = 0
field(190) = 34
field(195) = 0
field(199) = 0
field(235) = 8
field(241) = 50

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.
[/text]