Coder Social home page Coder Social logo

raid-sleep's Introduction

Power down RAID disks after a specified timeout

This script can handle drives that don't work with hdparm -S because they lack power management features (like the popular WD RED series).

Also, all drives are powered up at the same time when an access to one of the drives is detected. This makes wake-up from standby a lot faster for RAID arrays, where the drives would wake up in sequence with normal hdparm power-down.

Requirements

  • Tested on Debian 8.11 (jessie):
    • python3 >= 3.4.2
    • hdparm >= 9.43

Install

  1. Edit raid-sleep.conf:
    • Use find /dev/disk/by-id and blkid to find out your disk IDs
  2. Read(!) and Execute sudo ./install.sh
    • This will set up a systemd service to start the program

raid-sleep's People

Contributors

dhewg avatar thomask77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raid-sleep's Issues

Spindown / Spinup loop

Hello Thomas,

i'm using your tool on my tiny self-made nas. It worked very well, until i did a upgrade to bullseye. I'm not sure if only the update causes the issue, but i did not changed much.

The tool began to spinup the disks immediately after spindown. So i got a spindown/spinup loop on every timeout-cycle. I checked /proc/disktats and i could watch diskstats changing while hdparm did the spindown. I could not figure out, what service/tool did the access, maybe its my mdraid.

I build a simple workaround to prevent the spindown/spinup loop by simply adding a spinup delay to your code. Every time the tool detects a spinup event (on disktat change), it checks if the spindown was performed within the configured delaytime (defaulting to 3 secs, which seems to be enough) and skips any action in this case.
It contionously get the stats, so after this delay time it will check again if disktstats changed.

I'm not sure if it is good fix, but maybe other people have the same issue and can get helped with this

regards
Andreas

spinup-delay.patch.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.