{"id":2965,"date":"2021-02-05T02:06:27","date_gmt":"2021-02-04T17:06:27","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=2965"},"modified":"2021-02-05T02:06:27","modified_gmt":"2021-02-04T17:06:27","slug":"check-the-hard-disk-temperature-with-drivetemp","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2021\/02\/05\/check-the-hard-disk-temperature-with-drivetemp\/","title":{"rendered":"drivetemp\u3067\u30cf\u30fc\u30c9\u30c7\u30a3\u30b9\u30af\u306e\u6e29\u5ea6\u3092\u78ba\u8a8d\u3059\u308b"},"content":{"rendered":"<div class=\"paragraph\">\n<p>\u5148\u65e5Debian sid amd64\u74b0\u5883\u3067apt upgrade\u3057\u305f\u3068\u304d\u306bhddtemp\u306eNEWS\u304c\u3042\u308b\u3053\u3068\u306b\u6c17\u3065\u304d\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ zcat \/usr\/share\/doc\/hddtemp\/NEWS.Debian.gz\nhddtemp (0.3-beta15-54) unstable; urgency=medium\n\n  hddtemp has been dead upstream for many years and is therefore in a minimal\n  maintenance mode. It will be shipped in the Debian Bullseye release, but\n  will not be present in the Debian Bookworm release.\n\n  Nowadays the 'drivetemp' kernel module is a better alternative. It uses the\n  Linux Hardware Monitoring kernel API (hwmon), so the temperature is returned\n  the same way and using the same tools as other sensors.\n\n  Loading this module is as easy as creating a file in the \/etc\/modules-load.d\n  directory:\n\n    echo drivetemp &gt; \/etc\/modules-load.d\/drivetemp.conf\n\n -- Aurelien Jarno &lt;aurel32@debian.org&gt;  Tue, 02 Feb 2021 20:27:44 +0100<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>hddtemp\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u6e29\u5ea6\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ sudo hddtemp \/dev\/sda\n\/dev\/sda: Seagate BarraCuda SSD ZA0100MC0100 2    : 41\u00b0C<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3057\u304b\u3057\u3053\u306eNEWS\u306b\u3088\u308b\u3068 hddtemp \u306f\u3082\u3046\u4e0a\u6d41\u3067\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u3067Debian\u306e\u6b21\u671f\u30d0\u30fc\u30b8\u30e7\u30f3\u306e Bullseye \u306b\u306f\u5165\u308b\u3051\u3069\u305d\u306e\u6b21\u306e Bookworm \u304b\u3089\u306f\u9664\u304b\u308c\u308b\u4e88\u5b9a\u306e\u3088\u3046\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u305d\u3057\u3066 <code>drivetemp<\/code> \u3068\u3044\u3046\u30ab\u30fc\u30cd\u30eb\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u4ee3\u66ff\u306b\u306a\u308b\u3068\u306e\u3053\u3068\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3066\u3053\u3068\u3067\u5c11\u3057\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>drivetemp\u306b\u3064\u3044\u3066\u306fkernel\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u78ba\u8a8d\u3057\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"exampleblock\">\n<div class=\"title\">\u4f8b 1. <code>zcat \/usr\/share\/doc\/linux-doc-5.10\/Documentation\/hwmon\/drivetemp.rst.gz | rst2html | w3m -T text\/html<\/code><\/div>\n<div class=\"content\">\n<div class=\"paragraph\">\n<p>Kernel driver drivetemp<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>References<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>ANS T13\/1699-D Information technology &#8211; AT Attachment 8 &#8211; ATA\/ATAPI Command Set<br \/>\n(ATA8-ACS)<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>ANS Project T10\/BSR INCITS 513 Information technology &#8211; SCSI Primary Commands &#8211;<br \/>\n4 (SPC-4)<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>ANS Project INCITS 557 Information technology &#8211; SCSI \/ ATA Translation &#8211; 5<br \/>\n(SAT-5)<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Description<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>This driver supports reporting the temperature of disk and solid state drives<br \/>\nwith temperature sensors.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>If supported, it uses the ATA SCT Command Transport feature to read the current<br \/>\ndrive temperature and, if available, temperature limits as well as historic<br \/>\nminimum and maximum temperatures. If SCT Command Transport is not supported,<br \/>\nthe driver uses SMART attributes to read the drive temperature.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Usage Note<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Reading the drive temperature may reset the spin down timer on some drives.<br \/>\nThis has been observed with WD120EFAX drives, but may be seen with other drives<br \/>\nas well. The same behavior is observed if the &#8216;hdtemp&#8217; or &#8216;smartd&#8217; tools are<br \/>\nused to access the drive. With the WD120EFAX drive, reading the drive<br \/>\ntemperature using the drivetemp driver is still possible <em>after<\/em> it<br \/>\ntransitioned to standby mode, and reading the drive temperature in this mode<br \/>\nwill not cause the drive to change its mode (meaning the drive will not spin<br \/>\nup). It is unknown if other drives experience similar behavior.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>A known workaround for WD120EFAX drives is to read the drive temperature at<br \/>\nintervals larger than twice the spin-down time. Otherwise affected drives will<br \/>\nnever spin down.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Sysfs entries<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Only the temp1_input attribute is always available. Other attributes are<br \/>\navailable only if reported by the drive. All temperatures are reported in<br \/>\nmilli-degrees Celsius.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502temp1_input  \u2502Current drive temperature                                      \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502temp1_lcrit  \u2502Minimum temperature limit. Operating the device below this     \u2502<br \/>\n\u2502             \u2502temperature may cause physical damage to the device.           \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502temp1_min    \u2502Minimum recommended continuous operating limit                 \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502temp1_max    \u2502Maximum recommended continuous operating temperature           \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502temp1_crit   \u2502Maximum temperature limit. Operating the device above this     \u2502<br \/>\n\u2502             \u2502temperature may cause physical damage to the device.           \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502temp1_lowest \u2502Minimum temperature seen this power cycle                      \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502temp1_highest\u2502Maximum temperature seen this power cycle                      \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>drivetemp\u3092\u8aad\u307f\u8fbc\u3080\u3068Sysfs \u3067 <code>temp1_input<\/code> \u3068\u3057\u3066\u51fa\u3066\u304f\u308b\u3088\u3046\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u73fe\u5728\u306e\u30bb\u30f3\u30b5\u30fc\u306e\u4e00\u89a7\u3092\u53d6\u5f97\u3057\u307e\u3059\uff0e<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ find \/sys\/ -name \"temp1_input\" &gt; \/tmp\/before.list 2&gt;\/dev\/null\n$ cat \/tmp\/before.list\n\/sys\/devices\/platform\/thinkpad_hwmon\/hwmon\/hwmon3\/temp1_input\n\/sys\/devices\/platform\/coretemp.0\/hwmon\/hwmon4\/temp1_input\n\/sys\/devices\/virtual\/thermal\/thermal_zone0\/hwmon0\/temp1_input<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\"><code>drivetemp<\/code> \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8aad\u307f\u8fbc\u307f<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ sudo modprobe -v drivetemp\ninsmod \/lib\/modules\/5.10.0-3-amd64\/kernel\/drivers\/hwmon\/drivetemp.ko<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"admonitionblock note\">\n<table  class=\" table table-hover\" >\n<tbody>\n<tr>\n<td class=\"icon\">\n<div class=\"title\">Note<\/div>\n<\/td>\n<td class=\"content\">\n\u6c38\u7d9a\u5316\u3057\u305f\u3044\u5834\u5408\u306f<br \/>\n<code>$ echo drivetemp | sudo tee \/etc\/modules-load.d\/drivetemp.conf<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u5897\u3048\u305f\u30bb\u30f3\u30b5\u3092\u78ba\u8a8d<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ find \/sys\/ -name \"temp1_input\" 2&gt;\/dev\/null | diff -u \/tmp\/before.list -\n--- \/tmp\/before.list    2021-02-05 01:45:58.691517588 +0900\n+++ -   2021-02-05 01:46:00.178371154 +0900\n@@ -1,3 +1,4 @@\n \/sys\/devices\/platform\/thinkpad_hwmon\/hwmon\/hwmon3\/temp1_input\n \/sys\/devices\/platform\/coretemp.0\/hwmon\/hwmon4\/temp1_input\n+\/sys\/devices\/pci0000:00\/0000:00:1f.2\/ata1\/host0\/target0:0:0\/0:0:0:0\/hwmon\/hwmon6\/temp1_input\n \/sys\/devices\/virtual\/thermal\/thermal_zone0\/hwmon0\/temp1_input<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u6e29\u5ea6\u3092\u78ba\u8a8d<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ cat \/sys\/devices\/pci0000:00\/0000:00:1f.2\/ata1\/host0\/target0:0:0\/0:0:0:0\/hwmon\/hwmon6\/temp1_input\n44000\n$ sudo hddtemp \/dev\/sda\n\/dev\/sda: Seagate BarraCuda SSD ZA0100MC0100 2    : 44\u00b0C<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><code>hddtemp<\/code> \u3068\u540c\u3058\u7d50\u679c\u304c\u53d6\u5f97\u3067\u304d\u307e\u3057\u305f\uff0e\u540c\u3058\u306a\u306e\u3067 <code>drivetemp<\/code> \u306e\u5024\u306f\u6442\u6c0f\u306e\u3088\u3046\u3067\u3059\u306d :)<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3068\u308a\u3042\u3048\u305a\u6e29\u5ea6\u306f\u53d6\u5f97\u3067\u304d\u307e\u3057\u305f\u304c\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u6e29\u5ea6\u3092\u53d6\u5f97\u3057\u305f\u308a\u30c7\u30fc\u30e2\u30f3\u306a\u3069\u306f\u4f7f\u3048\u306a\u3044\u306e\u3067\u305d\u306e\u3078\u3093\u306f\u5c11\u3057\u8003\u3048\u306a\u3044\u3068\u3044\u3051\u306a\u3055\u305d\u3046\u3067\u3059\uff0e<\/p>\n<\/div>\n<p><iframe style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=matokensmeme-22&amp;language=ja_JP&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=as_ss_li_til&amp;asins=B08PXX5HZ8&amp;linkId=be80db07dfac069d4aa6df669eebf4fa\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u65e5Debian sid amd64\u74b0\u5883\u3067apt upgrade\u3057\u305f\u3068\u304d\u306bhddtemp\u306eNEWS\u304c\u3042\u308b\u3053\u3068\u306b\u6c17\u3065\u304d\u307e\u3057\u305f\uff0e $ zcat \/usr\/share\/doc\/hddtemp\/NEWS.Debian.gz hd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[7,6,199],"tags":[581,370,582],"class_list":["post-2965","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-sid","tag-drivetemp","tag-hddtemp","tag-tempture"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/2965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=2965"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/2965\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=2965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=2965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=2965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}