Showing Posts From

Hdparm

Spin Down and Manage Hard Drive Power on Raspberry Pi - sleep hdd hd-idle

Spin Down and Manage Hard Drive Power on Raspberry Pi - sleep hdd hd-idle

This is an example how you to set the hard drive into a standby or hibernate mode after a defined time. This saves power and protects the hard drive in continuous or server use. Requirements:A mounted USB hard drive (Tutorial)As a first step we need to update the package lists of Raspbian. We further need to install hdparm. sudo apt-get update && sudo apt-get -y install hdparmTo figure the name under which the hard drive is mounted in the system we need to use the following command. In this example, it is /dev/sda sudo fdisk -lWe check the current power mode status. In case it returns the status unknown, it is impossible to set the hard drive to a standby mode. Your HDD does not support spin down/hd-idle. sudo hdparm -C /dev/sda "-C shows the current "Power-Mode-Status" of an IDE hard drive. The return value can have the following states:"unknown" - The hard drive does not support the command "active"/"idle" - Standard operation "standby" - Low power mode, the hard drive does not spin or even sleeps completely The options -S, -y, -Y and -Z can be used to change the IDE power mode. wiki.debianforum.deWe use the parameter -y to set the hard drive to the standby mode. The hard drive should now be completely quiet. The command sudo hdparm -C /dev/sda can be used to check if the hard drive is in standy mode. As soon as the hard drive is accessed it should start to spin again. sudo hdparm -y /dev/sdaNow we need the UUID of the hard drive. Type the following command into the console and note the UUID of the hard drive. sudo blkidOpen the hdparm config file with the text editor Nano. sudo nano /etc/hdparm.conf Replace yourUUID with the previously noted UUID and add the text shown below at the end of the file. Exit the Nano text editor afterwards with Strg+x (Win) ctrl+x (Mac) and confirm the changes with y or j (depending on your language settings)./dev/disk/by-uuid/yourUUID { spindown_time = 240 } The number behind spindown_time tells after what time the hard drive will be set to its standby mode. Choose the time not to short as a continuous start-up of the hard drive will harm its motor and mechanics. 0 = Standy activated 60 = 5Min (60*5Sec=300Sec=5Min) 240 = 20Min (240*5Sec=1200Sec=20Min) From 240 the calcuation changes 241 = 30Min (1*30Min) 242 = 60Min (2*30Min)Now restart the system with the command shown below. After that the hard drive will automatically go into standby mode after the time you have set. sudo reboot

Raspberry Pi: Festplatte automatisch in den Standby/Ruhemodus schalten mit hdparm

Raspberry Pi: Festplatte automatisch in den Standby/Ruhemodus schalten mit hdparm

Ein Beispiel wie ihr die Festplatte nach einer vorgegeben Zeit in den Standby/Ruhemodus versetzt. Das spart Strom und schont die Festplatte im Dauer-/Serverbetrieb. Voraussetzung:USB Festplatte im System eingebunden/mounted (Anleitung)Als erstes aktualisierst wir die Paketlisten von Raspbian und installierst hdparm. sudo apt-get update && sudo apt-get -y install hdparmUm herauszufinden unter welchen Namen die Festplatte im System läuft, geben wir folgenden Befehl ein. In unserem Beispiel ist es /dev/sda sudo fdisk -lWir überprüfen den aktuellen Power-Mode-Status. Falls ihr den Status unknown zurück bekommt lässt sich die Festplatte nicht in Standby versetzen. sudo hdparm -C /dev/sda "-C zeigt den aktuellen „Power-Mode-Status“ einer IDE-Festplatte an. Dieser kann folgende Werte annehmen: „unknown“ - Das Laufwerk unterstützt dieses Kommando nicht; „active“/„idle“ - Normalbetrieb; „standby“ - Low Power Modus, die Festplatte dreht sich nicht oder „schläft“ sogar komplett. Die Optionen -S, -y, -Y und -Z können zur Veränderung der IDE-Power-Modes verwendet werden. " wiki.debianforum.deMit dem Parameter -y versetzen wir die Festplatte in den Standby Modus. Die Festplatte sollte jetzt kein Geräusch mehr von sich geben. Ihr könnte aber auch mit sudo hdparm -C /dev/sda überprüfen ob sich die Festplatte im standby befindet. Sobald auf die Festplatte zugegriffen wird, läuft sie wieder an. sudo hdparm -y /dev/sdaWir benötigen die UUID der Festplatte. Gebt folgenden Befehl in die Console ein und notiert euch die UUID der Festplatte. sudo blkidÖffnet die hdparm config Datei mit dem Nano Texteditor. sudo nano /etc/hdparm.conf Ersetzt deineUUID mit eurer zuvor notierten UUID und fügt den Text am Ende der Datei ein. Beendet den Nano Editor nach dem einfügen mit Strg+x (Win) ctrl+x (Mac) und bestätige die Änderung mit y oder j (je nach Spracheinstellung)./dev/disk/by-uuid/deineUUID { spindown_time = 240 } Die Zahl hinter spindown_time gibt an wann die Festplatte in den Ruhezustand gehen soll. Wählt die Zeit nicht zu kurz, da ständiges anfahren der Festplatte dem Motor/Mechanik schadet. 0 = Ruhezustand deaktiviert 60 = 5Min (60*5Sek=300Sek=5Min) 240 = 20Min (240*5Sek=1200Sek=20Min) Ab 240 ändert sich die Berechnung! 241 = 30Min (1*30Min) 242 = 60Min (2*30Min)Führt einen Neustart durch. Danach geht die Festplatte zu der Eingestellten Zeit automatisch in den Standby/Ruhemodus. sudo reboot