[Energy Savings] sheduled ON/OFF

  • Hello OMV community,


    I'm sorry, I'm a long time user of Openmediavault and never took the time to register before now.


    I own a little repair shop in france.
    I use OMV for years and really love it.
    I also tried others NAS alternatives including commercial ones (Synology) and open-source ones.
    For exemple I find OMV superior to freeNAS because FreeNAS is too complex, ZFS is overkill and needs too much RAM, and also OMV is simple and reliable (a FreeNAS appliance doesn't support a unexepected loss of power.. OMV is much more resilient to it)
    I have built a dozen of OMV appliances for both friends, personal use, relatives and even customers.
    I mainly build them based on :

    • taiwanese CFI A7879 ITX cases (and now A7979) with 4x hot swapable bays
    • ITX boards
    • tiny 16 GB SSD for hosting OMV os (i recently bought a lot of intel Optane 16GB NVMe ssds for a very low price which are perfect for hosting OMV)


    Those setups are quite good performer, are cheap and reliable and don't consume a lot of power (between 15W idle to 40W at full charge)
    I promise I'll present my setup in the appropriate section of the forum :)



    After years of experience, I would like to share some settings that I found important for a home or small office use of OMV.


    The aim is to get a longer life of hard disks, save power, and get a better life expectancy of the whole hardware.



    1 advanced power management of disks

    I prefer to set each disk "advanced power management mode" to 127 (intermediate power management with standby), and I would love this setting would be on by default.
    In a home or small office setting, I see absolutely no reason why a disk would rotate all day or night even if nobody will access it for hours...


    I may be wrong but to me, all disks inserted in a OMV setup should have their advanced power management mode set to 127..


    Capture d’écran 2019-08-15 à 17.03.23.png




    2 scheduled on and off


    There is no way to simply set a scheduled daily power on and off with OMV.
    Of course yes, as of today you can go on the "power management" settings panel and add a scheduled power off.
    But how to set a scheduled power on ? I can't pretend asking for people (friends / family) or small business customers to plug a display / keyboard, and set the "wake from S5" setting in the bios...


    This is something that has made me prefer Synology appliances only because the setting was simple, and I was sure no energy would be wasted and the whole system and disk would have a best life expectancy over years...


    I have long thought about it and here is the setting I use.
    Here is an example for an office use of an OMV appliance (sheduled power on each day at 8:00, sheduled power off at 18:00)



    As for the sheduled power off, this is straightforward :

    • go to the "power management" panel of OMV then on the "sheduled jobs" tab
    • add a scheduled job of type "shutdown", at exactly 18:00, every day (*)


    Capture d’écran 2019-08-15 à 17.26.00.png




    As for the sheduled power on


    this is a little bit complicated.
    I found interesting infos here :
    https://ragsagar.wordpress.com…-rtc-alarm-in-arch-linux/


    I want the NAS to shut down at 18:00 and power on 14 hours later each at 8:00 week day.
    On friday at 18:00 I want the NAS to shut down and power on 62 hours later at 8:00 on the monday.


    Here is how I do it :

    • on the first 4 "week day", 4 sheduled job sends each hour the rtcalarm a command to wake up 14 hours later.
    • on friday, 1 sheduled job is set to send the rtcalarm a command to wake up 62 hours later.


    The command is :


    Code
    echo 0 > /sys/class/rtc/rtc0/wakealarm & echo `date '+%s' -d '+ 840 minutes'` > /sys/class/rtc/rtc0/wakealarm


    The five sheduled jobs are as follow :


    Capture d’écran 2019-08-15 à 18.21.29.png



    Capture d’écran 2019-08-15 à 18.21.37.png




    Please tell me if you find those settings useful.
    Don't you think wether those settings may be on "by default" ? Should I make a feature request ?

  • Quote from @gilles_aurejac

    all disks inserted in a OMV setup should have their advanced power management mode set to 127..

    Could you please explain your reasoning for these three settings in Physical disk properties? I have always wondered what settings to pick and why. Thanks.

    RAID is NOT a backup and not useful for most home users. Rsync makes true backup and restoration stupid easy, and it's built right in to OMV. Use this command in a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-NAMEofSOURCEdisk/ /srv/dev-disk-by-label-NAMEofDESTINATIONdisk/

    Hardware: OMV 5 (current) - NanoPi M4: Nextcloud, Plex, & Heimdall - Acer Aspire T180: backup - Odroid XU4: Pi-Hole (DietPi) - Odroid HC2, Raspberry Pi 3B+, and HP dx2400: testing.

  • 1 advanced power management of disks


    I prefer to set each disk "advanced power management mode" to 127 (intermediate power management with standby), and I would love this setting would be on by default.
    In a home or small office setting, I see absolutely no reason why a disk would rotate all day or night even if nobody will access it for hours...


    I may be wrong but to me, all disks inserted in a OMV setup should have their advanced power management mode set to 127..

    Anybody else have experience/insight/opinion on this? I have always just used the first minimal settings found in @TechnoDadLife videos on omv setup at the 8 minute mark. Here is a pic of those settings under Disks tab:


    Screen Shot 2019-09-24 at 1.49.10 PM.png



    Anybody chime in. I would love to see the range of replies with reasoning.

    RAID is NOT a backup and not useful for most home users. Rsync makes true backup and restoration stupid easy, and it's built right in to OMV. Use this command in a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-NAMEofSOURCEdisk/ /srv/dev-disk-by-label-NAMEofDESTINATIONdisk/

    Hardware: OMV 5 (current) - NanoPi M4: Nextcloud, Plex, & Heimdall - Acer Aspire T180: backup - Odroid XU4: Pi-Hole (DietPi) - Odroid HC2, Raspberry Pi 3B+, and HP dx2400: testing.

  • Low values mean more aggressive power management and higher values mean better performance. Values from 1 to 127 permit spin-down, whereas values from 128 to 254 do not.


    I tried to avoid more aggressive power management to reduce the mechanical stress for the drive. So if I wanted to have spin-down I selected 127.


    However, I still had issues with hdparm as load-cylce-count increased dramatically and the drive would have reached the specified value within few months. I switched to hd-idle and since then load cycle count did not increase significantly.


    Of course it does not matter on the HC2 as the USB-to-SATA-controller is managing spin-down.

  • Quote from @macom

    Of course it does not matter on the HC2 as the USB-to-SATA-controller is managing spin-down.

    I remember reading something about that, I think from @tkaiser. You should just to leave the settings on Disable.



    Quote from @macom

    I switched to hd-idle and since then load cycle count did not increase significantly.

    okay, Great.

    RAID is NOT a backup and not useful for most home users. Rsync makes true backup and restoration stupid easy, and it's built right in to OMV. Use this command in a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-NAMEofSOURCEdisk/ /srv/dev-disk-by-label-NAMEofDESTINATIONdisk/

    Hardware: OMV 5 (current) - NanoPi M4: Nextcloud, Plex, & Heimdall - Acer Aspire T180: backup - Odroid XU4: Pi-Hole (DietPi) - Odroid HC2, Raspberry Pi 3B+, and HP dx2400: testing.

  • Hi there,


    a little update quite some months ago : I have two things to notify here.
    First, I had a problem with my NAS not waking up randomly... I have figured what occured here.
    Second, there is a much more simple way to do a scheduled on/off for energy savings.
    Explanations follow :


    1 - problem of NAS randomly not starting on at scheduled time

    Problem : Randomly, my NAS didn't properly start at the scheduled time. This was quite annoying...
    I found the solution here :
    https://www.mythtv.org/wiki/AC…p#Disable_hwclock_updates
    At shutdown "most Linux distributions write the current system time back to the RTC when shutting down the machine [...] and the machine will not wake up if the hardware clock has been modified after the wakeup alarm has been set"
    Solution : "disable the writing of the current system time to the RTC by the system shutdown scripts"
    On an OMV machine we do this by editing the /etc/default/hwclock file and replace #HWCLOCKACCESS=yes by HWCLOCKACCESS=no


    2 - Simplifed method for sheduled power on


    There is a way much simpler method for waking up the NAS at sheduled time that the script I did...
    It is so simple that I am ashamed: you only need to install the openmediavault-wakealarm plugin, and this is done in 2 steps :


    1 - add the omv-extra repository :
    https://forum.openmediavault.o…49-OMV-Extras-org-Plugin/
    for OMV 4.x this only file is needed : github.com/OpenMediaVault-Plug…extrasorg_latest_all4.deb
    2 - update and install the openmediavault-wakealarm plugin


    Then you have this new menu on the left :


    And you can then set some scheduled "day of week" startup as follow :


    Capture d’écran 2020-02-01 à 23.33.41.png



    Both 2 things add full power saving to OMV :
    - modification of the /etc/default/hwclock file
    - openmediavault-wakealarm plugin
    Maybe I could suggest that they would be included by default, what any of you think of it ?

  • Hi there,


    a little update quite some months ago : I have two things to notify here.
    First, I had a problem with my NAS not waking up randomly... I have figured what occured here.
    Second, there is a much more simple way to do a scheduled on/off for energy savings.
    Explanations follow :


    1 - problem of NAS randomly not starting on at scheduled time

    Problem : Randomly, my NAS didn't properly start at the scheduled time. This was quite annoying...
    I found the solution here :
    https://www.mythtv.org/wiki/AC…p#Disable_hwclock_updates
    At shutdown "most Linux distributions write the current system time back to the RTC when shutting down the machine [...] and the machine will not wake up if the hardware clock has been modified after the wakeup alarm has been set"
    Solution : "disable the writing of the current system time to the RTC by the system shutdown scripts"
    On an OMV machine we do this by editing the /etc/default/hwclock file and replace #HWCLOCKACCESS=yes by HWCLOCKACCESS=no


    2 - Simplifed method for sheduled power on


    There is a way much simpler method for waking up the NAS at sheduled time that the script I did...
    It is so simple that I am ashamed: you only need to install the openmediavault-wakealarm plugin, and this is done in 2 steps :


    1 - add the omv-extra repository :
    https://forum.openmediavault.o…49-OMV-Extras-org-Plugin/
    for OMV 4.x this only file is needed : github.com/OpenMediaVault-Plug…extrasorg_latest_all4.deb
    2 - update and install the openmediavault-wakealarm plugin


    Then you have this new menu on the left :


    And you can then set some scheduled "day of week" startup as follow :


    Capture d’écran 2020-02-01 à 23.33.41.png



    Both 2 things add full power saving to OMV :
    - modification of the /etc/default/hwclock file
    - openmediavault-wakealarm plugin
    Maybe I could suggest that they would be included by default, what any of you think of it ?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!