{"id":17102,"date":"2020-07-25T17:21:57","date_gmt":"2020-07-25T15:21:57","guid":{"rendered":"https:\/\/www.michael-floessel.de\/mfblog\/?p=17102"},"modified":"2020-07-25T17:21:57","modified_gmt":"2020-07-25T15:21:57","slug":"der-pi-die-usb-festplatte-und-das-abschalten-eine-quick-dirty-loesung","status":"publish","type":"post","link":"https:\/\/www.michael-floessel.de\/mfblog\/der-pi-die-usb-festplatte-und-das-abschalten-eine-quick-dirty-loesung\/","title":{"rendered":"Der Pi, die USB-Festplatte und das Abschalten &#8211; Eine Quick &#038; Dirty L\u00f6sung"},"content":{"rendered":"<h2><strong><a href=\"https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/uploads\/2019\/04\/pi-1200usb.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-16174 size-medium\" src=\"https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/uploads\/2019\/04\/pi-1200usb-320x214.jpg\" alt=\"pi-1200usb\" width=\"320\" height=\"214\" srcset=\"https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/uploads\/2019\/04\/pi-1200usb-320x214.jpg 320w, https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/uploads\/2019\/04\/pi-1200usb-150x100.jpg 150w, https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/uploads\/2019\/04\/pi-1200usb.jpg 1200w, https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/uploads\/2019\/04\/pi-1200usb-449x300.jpg 449w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a>Ein Provisorium<\/strong><\/h2>\n<p>Wieder einmal vorweg muss ich erw\u00e4hnen, dass ich mir hier eine Notl\u00f6sung notiere. Es geht sicherlich eleganter, wahrscheinlich liegt es an mir, die Aufgabe nicht sauberer zu l\u00f6sen. Zumindest zum jetzigen Zeitpunkt <img src=\"https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/plugins\/classic-smilies\/img\/icon_wink.gif\" alt=\";-)\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p>\n<h4><strong>Das Problem<\/strong><\/h4>\n<p>Ich habe an meinem Pi-2B+ eine 3TB-USB-Festplatte im 3,5 Zoll-Format in Betrieb. Da der Raspi eigentlich als NAS fungiert, soll diese \u00fcber gr\u00f6\u00dfere Zeitr\u00e4ume der Inaktivit\u00e4t in den Standby-Modus wechseln, was sie aber von alleine leider nicht erledigt. Am DVD-Player und Windows-PC schon, am Pi aber bl\u00f6derweise eben nicht.<\/p>\n<h4><strong>Versuche<\/strong><\/h4>\n<p>Ich habe mittlerweile hadparm, sdparm, tlp und hd-idle durchgetestet, niemals hat sich der gew\u00fcnschte Erfolg eingestellt.<\/p>\n<h4><strong>Notl\u00f6sung<\/strong><\/h4>\n<p>Lediglich mit dem Komando &#8222;haparm -Y \/dev\/sda schaltet sie unverz\u00fcglich ab. Egal mit welchem -B oder -S, f\u00fcr den Powerlevel bzw. die Spindownzeit ich ansonsten in der hdparm.config arbeite, das Ding bleibt an.<\/p>\n<p>Bei allen anderen Tools au\u00dfer hdparm, erreiche ich gar nichts. Da ich nach knapp 3 Tagen herumfummeln einfach im Augenblick keine weitere Zeit in diese Geschichte stecken kann und will, lasse ich die Festplatte nun alle drei Stunden via hdparm und crontab in den Standby-Modus wechseln. Das funktioniert gut und scheint(!) auch keine Probleme zu bereiten, wenn gerade Aktivit\u00e4t auf dem Laufwerk herrscht. Es f\u00e4hrt dann allerdings herunter und startet unverz\u00fcglich neu. Mehr brauche ich aber eigentlich nicht, also belasse ich es vorerst dabei.<\/p>\n<h4><strong>Was vorher noch zu erledigen ist:<\/strong><\/h4>\n<p>Nat\u00fcrlich muss <a title=\"hdparm installieren\" href=\"https:\/\/maker-tutorials.com\/raspberry-pi-festplatte-automatisch-standby-hdparm\/\" target=\"_blank\" rel=\"noopener noreferrer\">hdparm installiert<\/a> sein, was mit<\/p>\n<p><em>sudo apt-get install hdparm -y<\/em><\/p>\n<p>schnell zu erledigen ist.<\/p>\n<p>Ein kleines Script sollte erstellt werden, in welchem &#8222;<em>hdparm<\/em>&#8220; aufgerufen wird. Anders als per Script habe ich es gar nicht versucht, da ich mir immer die M\u00f6glichkeit offen halten m\u00f6chte, solche Vorg\u00e4nge zu erweitern.<\/p>\n<p>In meinem Fall hei\u00dft das Script &#8222;<em>runcron.sh<\/em>&#8222;, liegt in \/bin\/, wurde vom User &#8222;<em>root<\/em>&#8220; angelegt und enth\u00e4lt die Zeilen:<\/p>\n<p><em>#!\/bin\/bash<\/em><\/p>\n<p><em>sudo \/sbin\/hdparm -Y \/dev\/sda<\/em><\/p>\n<p>Daran denken, die Datei mit<\/p>\n<p><em>sudo chmod +x \/bin\/runcron.sh<\/em><\/p>\n<p>ausf\u00fchrbar zu machen <img src=\"https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/plugins\/classic-smilies\/img\/icon_wink.gif\" alt=\";-)\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p>\n<p>Ein <a title=\"Cronjob Raspberry Pi\" href=\"http:\/\/www.raspberrypi-tutorials.de\/software\/cronjobs-auf-dem-raspberry-pi-erstelleneinrichten.html\" target=\"_blank\" rel=\"noopener noreferrer\">Cronjob<\/a> muss eingerichtet werden.<\/p>\n<p>Per<\/p>\n<p><em>crontab -e<\/em><\/p>\n<p>die Tabelle einrichten bzw. die folgende Zeile hinzuf\u00fcgen:<\/p>\n<p>0 *\/3 * * * \/bin\/runcron.sh<\/p>\n<p>Der Dateiname ist nat\u00fcrlich Ermessenssache.<\/p>\n<p>F\u00fcr die Vorarbeiten sind oben zus\u00e4tzlich Links hinterlegt, hier geht es ja gerade eher nur um Ruhepausen f\u00fcr die HDD.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<!-- relpost-thumb-wrapper --><div class=\"relpost-thumb-wrapper\"><!-- filter-class --><div class=\"relpost-thumb-container\"><style>.relpost-block-single-image, .relpost-post-image { margin-bottom: 10px; }<\/style><h3>Related posts:<\/h3><div style=\"clear: both\"><\/div><div style=\"clear: both\"><\/div><!-- relpost-block-container --><div class=\"relpost-block-container relpost-block-column-layout\" style=\"--relposth-columns: 4;--relposth-columns_t: 3; --relposth-columns_m: 2\"><a href=\"https:\/\/www.michael-floessel.de\/mfblog\/samsung-se-208db-externer-dvd-brenner\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><div class=\"relpost-block-single-image rpt-lazyload\" aria-hidden=\"true\" role=\"img\" data-bg=\"https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/uploads\/2014\/02\/Ext-DVD-Header.jpg\" style=\"background: transparent no-repeat scroll 0% 0%; width: 1000px; height: 288px; aspect-ratio: 16\/9;\"><\/div><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: rgb(237,201,23);\"><h4 class=\"relpost_card_title\">Samsung SE-208DB externer DVD Brenner<\/h4><\/div><\/div><\/a><a href=\"https:\/\/www.michael-floessel.de\/mfblog\/tagebuch-pc-heute-update\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><div class=\"relpost-block-single-image rpt-lazyload\" aria-hidden=\"true\" role=\"img\" data-bg=\"https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/uploads\/2026\/04\/the-joker-pic-4-michael-floessel.de_.jpg\" style=\"background: transparent no-repeat scroll 0% 0%; width: 1000px; height: 288px; aspect-ratio: 16\/9;\"><\/div><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: rgb(237,201,23);\"><h4 class=\"relpost_card_title\">Tagebuch PC heute, Update<\/h4><\/div><\/div><\/a><a href=\"https:\/\/www.michael-floessel.de\/mfblog\/hantek-6022be-usb-digital-oszilloskop\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><div class=\"relpost-block-single-image rpt-lazyload\" aria-hidden=\"true\" role=\"img\" data-bg=\"https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/uploads\/2014\/03\/Hantek-6022BE-USB-Digital-Oszilloskop-Header.jpg\" style=\"background: transparent no-repeat scroll 0% 0%; width: 1000px; height: 288px; aspect-ratio: 16\/9;\"><\/div><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: rgb(237,201,23);\"><h4 class=\"relpost_card_title\">Hantek 6022BE USB Digital Oszilloskop<\/h4><\/div><\/div><\/a><a href=\"https:\/\/www.michael-floessel.de\/mfblog\/erscheint-ubuntu-als-touchbasiertes-os-fur-mobile-endgerate-gerucht-linux-unix-pc-welt\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><div class=\"relpost-block-single-image rpt-lazyload\" aria-hidden=\"true\" role=\"img\" data-bg=\"https:\/\/www.michael-floessel.de\/mfblog\/wp-content\/uploads\/2026\/04\/the-joker-pic-4-michael-floessel.de_.jpg\" style=\"background: transparent no-repeat scroll 0% 0%; width: 1000px; height: 288px; aspect-ratio: 16\/9;\"><\/div><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: rgb(237,201,23);\"><h4 class=\"relpost_card_title\">Erscheint Ubuntu als touchbasiertes OS f\u00fcr mobile Endger\u00e4te? - Ger\u00fccht - Linux, Unix - PC-WELT<\/h4><\/div><\/div><\/a><\/div><!-- close relpost-block-container --><div style=\"clear: both\"><\/div><\/div><!-- close filter class --><\/div><!-- close relpost-thumb-wrapper -->","protected":false},"excerpt":{"rendered":"<p>Ein Provisorium Wieder einmal vorweg muss ich erw\u00e4hnen, dass ich mir hier eine Notl\u00f6sung notiere. Es geht sicherlich eleganter, wahrscheinlich liegt es an mir, die Aufgabe nicht sauberer zu l\u00f6sen. Zumindest zum jetzigen Zeitpunkt Das Problem Ich habe an meinem &hellip; <a href=\"https:\/\/www.michael-floessel.de\/mfblog\/der-pi-die-usb-festplatte-und-das-abschalten-eine-quick-dirty-loesung\/\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":16136,"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,"footnotes":""},"categories":[3173],"tags":[626,2343,3340,3328,83,164,3316,3318,3322,818,1622,1595,3321,3339,3317,3319,2659,3320,63],"class_list":["post-17102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi","tag-abschalten","tag-automatisch","tag-bash","tag-cron","tag-festplatte","tag-hdd","tag-hdparm","tag-laufwek","tag-lebensdauer","tag-linux","tag-pi","tag-raspberry","tag-schonung","tag-script","tag-sdparm","tag-sleep","tag-standby","tag-tlp","tag-usb"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.michael-floessel.de\/mfblog\/wp-json\/wp\/v2\/posts\/17102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.michael-floessel.de\/mfblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.michael-floessel.de\/mfblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.michael-floessel.de\/mfblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.michael-floessel.de\/mfblog\/wp-json\/wp\/v2\/comments?post=17102"}],"version-history":[{"count":0,"href":"https:\/\/www.michael-floessel.de\/mfblog\/wp-json\/wp\/v2\/posts\/17102\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.michael-floessel.de\/mfblog\/wp-json\/wp\/v2\/media?parent=17102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.michael-floessel.de\/mfblog\/wp-json\/wp\/v2\/categories?post=17102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.michael-floessel.de\/mfblog\/wp-json\/wp\/v2\/tags?post=17102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}