{"id":1135,"date":"2013-08-20T23:08:14","date_gmt":"2013-08-20T21:08:14","guid":{"rendered":"http:\/\/michlstechblog.info\/blog\/?p=1135"},"modified":"2013-08-21T10:38:47","modified_gmt":"2013-08-21T08:38:47","slug":"linux-switch-a-idle-hard-disk-into-standby-mode","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/linux-switch-a-idle-hard-disk-into-standby-mode\/","title":{"rendered":"Linux: Switch a idle hard disk into standby mode"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_1135 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_1135')){$('.twoclick_social_bookmarks_post_1135').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Linux%3A%20Switch%20a%20idle%20hard%20disk%20into%20standby%20mode\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0AI%20have%20running%20a%20debian%20based%20multimedia%20server.%20The%20operating%20systems%20is%20installed%20on%20a%20compact%20flash%20card%20%28%2Fdev%2Fsda%29%2C%20the%20data%20resides%20on%20a%20external%20USB%20SATA%20harddisk%20%28%2Fdev%2Fsdb%29.%0D%0AThe%20%28Server%20%3A-%29%20%29%20Hardware%20is%20a%20Fujitsu%20Futro%20A240%20ThinClient%2C%20with%20a%20power%20consumption%20of%20only%207W.%20I%27m%20using%20the%20server%20for%20about%202%20hours%20each%20day%2C%20therefore%20I%20looked%20for%20a%20method%20to%20save%20power%20and%20switch%20t%20...\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/linux-switch-a-idle-hard-disk-into-standby-mode\\\/\",\"post_id\":1135,\"post_title_referrer_track\":\"Linux%3A+Switch+a+idle+hard+disk+into+standby+mode\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>I have running a debian based multimedia server. The operating systems is installed on a compact flash card (\/dev\/sda), the data resides on a external USB SATA harddisk (\/dev\/sdb).<br \/>\nThe (Server \ud83d\ude42 ) Hardware is a Fujitsu Futro A240 ThinClient, with a power consumption of only 7W. I&#8217;m using the server for about 2 hours each day, therefore I looked for a method to save power and switch the USB disk to standby mode when its idle for while. <\/p>\n<p>Check first if your hard disk supports the standby mode.\u00a0 Ensure that the disk is idle, otherwise the disk is immediately active again.<\/p>\n<p>Switch to Standby mode<\/p>\n<pre><code>root@debdev:~# hdparm -y \/dev\/sdb<\/code>\r\n<!--more-->\r\n<code>\/dev\/sdb:\r\n    issuing standby command<\/code><\/pre>\n<p>and check it.<\/p>\n<pre><code>root@debdev:~# hdparm -C \/dev\/sdb<\/code>\r\n\r\n<code>\/dev\/sdb:\r\n    drive state is:\u00a0 standby<\/code><\/pre>\n<p>This can be done automatically if the disk is idle for a specific time. Use hdparm -S xx \/dev\/sdxx<br \/>\nThe parameter -S is the timeout value. The following table (from man hdparm manpage) describes the possible values:<\/p>\n<table style=\"width: 650px; border: 1px;\">\n<tbody>\n<tr>\n<th style=\"font: 14px\/1.5 verdana,helvetica,arial,sans-serif; text-transform: none; text-align: left; width: 150px;\">Parameter -S<\/th>\n<th style=\"font: 14px\/1.5 verdana,helvetica,arial,sans-serif; text-transform: none; text-align: left;\">Description<\/th>\n<th style=\"font: 14px\/1.5 verdana,helvetica,arial,sans-serif; text-transform: none; text-align: left;\">Time<\/th>\n<\/tr>\n<tr>\n<td>1 to 240<\/td>\n<td>specify multiples of 5<\/td>\n<td>5 to 1200 seconds(20min)<\/td>\n<\/tr>\n<tr>\n<td>241 to 251<\/td>\n<td>1 to 11 units of 30 minutes<\/td>\n<td>30 minutes to 5.5 hours<\/td>\n<\/tr>\n<tr>\n<td>252<\/td>\n<td>signifies a timeout of 21 minutes<\/td>\n<td>21 minutes<\/td>\n<\/tr>\n<tr>\n<td>253<\/td>\n<td>sets a vendor-defined timeout period between 8 and 12 hours.<\/td>\n<td>Vendor specific<\/td>\n<\/tr>\n<tr>\n<td>254<\/td>\n<td>reserved<\/td>\n<td>reserved<\/td>\n<\/tr>\n<tr>\n<td>255<\/td>\n<td>is interpreted as 21 minutes plus 15 seconds. Note: some older drives may have very different interpretations of these values<\/td>\n<td>21,25 minutes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The following command line sets the timeout to 15 minutes<\/p>\n<pre><code>\r\nroot@debdev:~# hdparm -S 180 \/dev\/sdb<\/code>\r\n<code>\/dev\/sdb:\r\n  setting standby to 180 (900 seconds)<\/code><\/pre>\n<p>You have to set the timeout each the the operating system starts. This can be done by editing the \/etc\/hdparm.conf file. Find an already defined and uncommented section for your disk or add a new one:<\/p>\n<pre><code>\r\n\/dev\/sdb {<\/code>\r\n<code>\r\n     spindown_time = 180<\/code>\r\n\r\n}<\/pre>\n<p>Nice powersaving:-)<\/p>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, I have running a debian based multimedia server. The operating systems is installed on a compact flash card (\/dev\/sda), the data resides on a external USB SATA harddisk (\/dev\/sdb). The (Server \ud83d\ude42 ) Hardware is a Fujitsu Futro A240 ThinClient, with a power consumption of only 7W. I&#8217;m using the server for about 2 &hellip; <a href=\"https:\/\/michlstechblog.info\/blog\/linux-switch-a-idle-hard-disk-into-standby-mode\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Linux: Switch a idle hard disk into standby mode<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[243,286,289,224,287,290,288,284],"class_list":["post-1135","post","type-post","status-publish","format-standard","hentry","category-linux","tag-automatically","tag-hard-disk","tag-hdparm","tag-linux-2","tag-on-idle","tag-sata","tag-standby","tag-usb"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/1135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=1135"}],"version-history":[{"count":34,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/1135\/revisions"}],"predecessor-version":[{"id":1160,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/1135\/revisions\/1160"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=1135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=1135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=1135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}