{"id":856,"date":"2020-03-06T18:48:21","date_gmt":"2020-03-06T17:48:21","guid":{"rendered":"https:\/\/codedoneright.eu\/?page_id=856"},"modified":"2021-01-01T19:04:40","modified_gmt":"2021-01-01T18:04:40","slug":"spin-down","status":"publish","type":"page","link":"https:\/\/codedoneright.eu\/?page_id=856","title":{"rendered":"Spin down for HDD"},"content":{"rendered":"\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Certain HDD enclosures do not allow for putting the drive in stand-by mode automatically. Fortunately you can run a script to spin down the drive periodically. If the drive is in use then it will spin down for just a moment. If the drive is in stand-by mode already, nothing will happen.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Purpose of the script<\/h4>\n\n\n\n<p>As the name suggests, it puts an HDD drive in stand-by mode (spin down). This script is useless for SSD drives as they do not need to be spanned down.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Additional packages required<\/h4>\n\n\n\n<ul><li>hdparm<\/li><\/ul>\n\n\n\n<p>Run the following code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install hdparm<\/code><\/pre>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Spin down script code<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\nsudo hdparm -y \/dev\/sda\nsudo hdparm -y \/dev\/sdb\nsudo hdparm -y \/dev\/sdc<\/code><\/pre>\n\n\n\n<p>Each drive should have its own line and it should point to the drive and not to a partition of a drive. <\/p>\n\n\n\n<p>Remember to amend the script to reflect your devices.<\/p>\n\n\n\n<div style=\"height:56px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>In order to run the script periodically use cron. Frequency should be set in accordance with your needs, if you use the drive frequently then set it to run every two or three hours.<\/p>\n\n\n\n<p><strong>NOTE<\/strong> if you are using the HDD at the moment the script is executed (e.g. watching a movie), you might notice a short slowdown or stutter when the script is executed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Certain HDD enclosures do not allow for putting the drive in stand-by mode automatically. Fortunately you can run a script to spin down the drive periodically. If the drive is in use then it will spin down for just a&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":414,"menu_order":10,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spin down for HDD script if all else fails &#8212; Code Done Right!<\/title>\n<meta name=\"description\" content=\"If you have problems with setting the spin down for your hard disk drives then check out this script to help you solve that problem\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codedoneright.eu\/?page_id=856\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Spin down for HDD script if all else fails &#8212; Code Done Right!\" \/>\n<meta name=\"twitter:description\" content=\"If you have problems with setting the spin down for your hard disk drives then check out this script to help you solve that problem\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codedoneright.eu\/?page_id=856\",\"url\":\"https:\/\/codedoneright.eu\/?page_id=856\",\"name\":\"Spin down for HDD script if all else fails &#8212; Code Done Right!\",\"isPartOf\":{\"@id\":\"https:\/\/codedoneright.eu\/#website\"},\"datePublished\":\"2020-03-06T17:48:21+00:00\",\"dateModified\":\"2021-01-01T18:04:40+00:00\",\"description\":\"If you have problems with setting the spin down for your hard disk drives then check out this script to help you solve that problem\",\"breadcrumb\":{\"@id\":\"https:\/\/codedoneright.eu\/?page_id=856#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codedoneright.eu\/?page_id=856\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codedoneright.eu\/?page_id=856#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codedoneright.eu\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux\",\"item\":\"https:\/\/codedoneright.eu\/?page_id=1026\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Running script\",\"item\":\"https:\/\/codedoneright.eu\/?page_id=414\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Spin down for HDD\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codedoneright.eu\/#website\",\"url\":\"https:\/\/codedoneright.eu\/\",\"name\":\"Code Done Right!\",\"description\":\"Raspberry Pi server guides\",\"publisher\":{\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codedoneright.eu\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568\",\"name\":\"CodeDoneRight\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png\",\"contentUrl\":\"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png\",\"width\":120,\"height\":120,\"caption\":\"CodeDoneRight\"},\"logo\":{\"@id\":\"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/codedoneright.eu\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spin down for HDD script if all else fails &#8212; Code Done Right!","description":"If you have problems with setting the spin down for your hard disk drives then check out this script to help you solve that problem","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codedoneright.eu\/?page_id=856","twitter_card":"summary_large_image","twitter_title":"Spin down for HDD script if all else fails &#8212; Code Done Right!","twitter_description":"If you have problems with setting the spin down for your hard disk drives then check out this script to help you solve that problem","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/codedoneright.eu\/?page_id=856","url":"https:\/\/codedoneright.eu\/?page_id=856","name":"Spin down for HDD script if all else fails &#8212; Code Done Right!","isPartOf":{"@id":"https:\/\/codedoneright.eu\/#website"},"datePublished":"2020-03-06T17:48:21+00:00","dateModified":"2021-01-01T18:04:40+00:00","description":"If you have problems with setting the spin down for your hard disk drives then check out this script to help you solve that problem","breadcrumb":{"@id":"https:\/\/codedoneright.eu\/?page_id=856#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codedoneright.eu\/?page_id=856"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/codedoneright.eu\/?page_id=856#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codedoneright.eu\/"},{"@type":"ListItem","position":2,"name":"Linux","item":"https:\/\/codedoneright.eu\/?page_id=1026"},{"@type":"ListItem","position":3,"name":"Running script","item":"https:\/\/codedoneright.eu\/?page_id=414"},{"@type":"ListItem","position":4,"name":"Spin down for HDD"}]},{"@type":"WebSite","@id":"https:\/\/codedoneright.eu\/#website","url":"https:\/\/codedoneright.eu\/","name":"Code Done Right!","description":"Raspberry Pi server guides","publisher":{"@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codedoneright.eu\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/50378701e349dbd5d40888bc5b532568","name":"CodeDoneRight","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/","url":"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png","contentUrl":"https:\/\/codedoneright.eu\/wp-content\/uploads\/www_icon.png","width":120,"height":120,"caption":"CodeDoneRight"},"logo":{"@id":"https:\/\/codedoneright.eu\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/codedoneright.eu"]}]}},"_links":{"self":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/856"}],"collection":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=856"}],"version-history":[{"count":7,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/856\/revisions"}],"predecessor-version":[{"id":1427,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/856\/revisions\/1427"}],"up":[{"embeddable":true,"href":"https:\/\/codedoneright.eu\/index.php?rest_route=\/wp\/v2\/pages\/414"}],"wp:attachment":[{"href":"https:\/\/codedoneright.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}