--- For OMV V5.x please see here. ---
I have read an learned a lot during my one week try and error sessions with my new OMV 2.2.13 system (with kernel 3.16.0-0.bpo.4-amd64). After I got my SnapRAID configuration running I tried to fine tune my little system. I was interested in 1) automatic HDD spin down as well as 2) automatic shut down (-> suspend, ACPI S3) after some idle time.
Topic 1) was for one out of my 3 different Toshiba HDDs not running out of the box, i.e. the related OMV setting in 'Storage -> Physical Disks' was not able to spin down this disk (the used command 'hdparm' is not working). I found then several information in:
HDD Spindown Probleme (GER)
which refers to:
Festplatten in den Standby-Modus versetzen unter Ubuntu Desktop/Server mit hd-idle (GER)
which refers to:
hd-idle on sourceforge.net (ENG)
Out of all these information I wrote these 'how to' steps:
*** Install 'hd-idle' in OMV (login as 'root' user) ***
** 0) install additional 'build / make' files **
apt-get install debhelper
apt-get install fakeroot
apt-get install build-essential
** 1) make a download directory **
** 1.1) enter the directory **
** 2) download the 'hd-idle' source package file **
** 2.1) extract the package **
tar xvfz hd-idle*.tgz
** 3) enter the extracted 'hd-idle' folder, it is one directory down **
** 4) make the '*.deb' file **
** 4.1) goto the made *.deb file, it is one directory up **
** 5) install the '*.deb' file **
dpkg -i hd-idle_*.deb
*** 'hd-idle' setup ***
** a) disable all spin-down and power management settings in OMV ***
'Storage -> Physical Disks'
** b) open the 'hd-idle' configuration file via the 'nano' editor **
** b.1) insert for each HDD (accessed via their UUIDs) a spin-down command '-a /dev/<...> -i 600', e.g. spin-down of 3 HDDs after approx. 600 seconds **
HD_IDLE_OPTS="-i 0 -a /dev/disk/by-uuid/bacb10a1-6dc5-48b9-a6f4-ed836b7dfa4a -i 600 -a /dev/disk/by-uuid/481b459f-aad7-468e-b0fe-9401c94eb4fc -i 610 -a /dev/disk/by-uuid/3b5e7398-d517-4477-a3b9-aa46c4347184 -i 620"
* hint: Parameter '-i 0' at the beginning avoids spin-down of not explicitly specified HDDs. *
** b.2) allow hd-idle to start **
** b.3) save the file and close 'nano' **
** c) via OMV auto-start the 'hd-idle' service (daemon) **
'System -> Scheduled Jobs'
* hint: use options 'reboot', user 'root' and command 'service hd-idle start' *
** d) do also this if the OMV plug in 'Autoshutdown' is in use **
** PROBLEM!!! The required 'systemd' service manager is not in use on Debian 7 / OMV 2.x! **
** e) reboot OMV, now it should work **
** f) Check that 'hd-idle' is running via OMV
'Diagnostics -> System Information -> Process List'
** in column 'Command' should be somewhere such an entry: **
usr/bin/hd-idle -i 0 -a /dev/<...> -i 620
Now I stuck with step d) because I'm not really familiar with Linux. The missing task is: How to restart the 'hd-idle' daemon after wakeup from suspend with the OMV 2.x used 'SysVinit'?
Hint: Without d) the 'hd-idle' service is still running but no longer functional, i.e. no further HDD spin down happens.
Could somebody help me, please?
After some further tests it seems it has nothing directly to do with the suspend and wake-up:
hd-idle obviously works in the following way: It reads in some interval from each HDD (or wherever these data are located) its performed reads and writes. If both counter values have not been changed in the defined spin down time (-i parameter) then a spin down will be triggered.
If the HDDs have been simply restartet due to e.g. a wake-up after a suspend then these counters still deliver the same values as at the time as hd-idle last send them to spin down state. This means 1. hd-idle is NOT aware that the HDDs are no longer in spin down state and 2. a further spin down trigger will never happen due to the not changed counters.
A workaround would be the above mentioned hd-idle daemon restart after wake-up ... (a read access would also release this blocking state but this is usually no way for the parity HDD in a SnapRAID system).