[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..





    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 (*)





    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 :







    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 ?

  • I have been looking to do something similar but on a daily basis. Shutting down was the easy bit, but thanks to your hard work and easy to follow guide, I now can get the server started again.



    Thank you.

    HP-Z620
    Xeon CPU E5-2690 @ 2.90GHz X 2
    112Gb DDR3 ECC RDimm Memory


    plugins: omvextrasorg | flashmemory | minidlna | cputemp | resetperms | wol | zfs

    • Offizieller Beitrag
    Zitat von @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.

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

    • Offizieller Beitrag

    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:




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

    • Offizieller Beitrag

    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.

    • Offizieller Beitrag
    Zitat von @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.



    Zitat von @macom

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

    okay, Great.

  • 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 :




    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 :




    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 ?

  • 2 - update and install the openmediavault-wakealarm plugin

    I am stuck on this step. I looked for the plugin using the keyword "wakealarm" under System>Plugin but I did not see the exact plugin. I installed the only query result called wake-on-lan which I don't think is the right one.


    Can someone provide me with a guide on how to install a plugin that did not come up in a search on the webinterface? Do I have to install it from the CLI? I googled and found a VCs link for the plugin on bintray but not sure how to install it because I am a new user to Linux OS.


    Any help is appreciated. Thank you.

  • If when searching for a plugin you spell it wrong you won't find it and "wake-alarm" is wrong. It's wakealarm.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

    • Offizieller Beitrag

    Nope. The RPi (and other arm boards as far as I know) doesn't support power management. What would be the point? It probably wouldn't use any less energy sitting a state that could be woken up anyway. Putting the drives to sleep is about the best option.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Nope. The RPi (and other arm boards as far as I know) doesn't support power management. What would be the point? It probably wouldn't use any less energy sitting a state that could be woken up anyway. Putting the drives to sleep is about the best option.

    Thank you. Can you point me to some resources on how to put an external hard drive to sleep? I believe it is doing it automatically as I could hear it spin down during inactivity but I want to make sure.

    • Offizieller Beitrag

    Can you point me to some resources on how to put an external hard drive to sleep?

    I assume most usb enclosures put them to sleep after a timeout. I don't put drives to sleep myself and don't use usb enclosures full time. So, I'm not much help.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    Can you point me to some resources on how to put an external hard drive to sleep? I believe it is doing it automatically as I could hear it spin down during inactivity but I want to make sure.

    You should consult the documentation of that drive. It should tell you what the standard configuration is and if/how it can be changed (if needed).

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!