Giter Club home page Giter Club logo

synology_hibernation_fixer's Introduction

Synology DSM HDD hibernation fixer script

This script allows to fix multiple issues which prevent Synology NAS to have working HDD hibernation.

It is especially useful if you setup Docker containers on an NVMe partition - by default Synology NASes have a flaw which prevents HDD disks to hibernate when there is an ongoing NVMe activity.

The script integrates changes I've described here and here

Features

  • synocrond tasks control
  • interactive mode to specify what to do with synocrond tasks to adjust to your NAS usage scenario
  • applying in-memory patches for DSM binaries which prevent HDD hibernation to function normally when there is an NVMe activity (allows for eg. to setup noisy Docker containers on an NVMe partition and have working HDD hibernation)
  • automatic remounting of rootfs as noatime to avoid random wake ups
  • setting noatime for disk volumes
  • persists after DSM upgrades. No need to reapply the script after DSM updates (as long as Synology doesn't break something)

The script should support all x86-based NAS models running DSM 7. Supported versions are 7.0, 7.1 and 7.2RC.

Some of the fixes might be usable on DSM 6 as well, but I don't have a NAS with DSM 6 to test.

How it works

Upon installation, the script creates a Task Scheduler task which is triggered to execute after a boot up. The task is self-contained - it has everything to execute within its body, so there is no need to keep the script .py-file anywhere on your NAS after installing.

As this kind of scheduled tasks is preserved by DSM during a DSM upgrade, this approach allows to safely persist between DSM updates. Internally DSM keeps these tasks inside a database which has other user-added tasks.

When invoked, the task verifies synocrond tasks configuration, changes their settings if necessary (like after a DSM update), applies other fixes and then exits - nothing left executing in the background.

The script logs its execution in the /var/log/hibernation_fixer.log file.

Usage

  • login into your NAS via ssh
  • (optionally) switch to root via sudo -i
  • copy hiber_fixer.py (or just paste it via ssh) to any place on your NAS
  • run sudo python3 hiber_fixer.py --install
  • (optionally) reboot your NAS

The script enumerates all synocrond tasks, prints their short descriptions and allows user to specify new triggering interval for every task (or delete them). The choices are saved inside the script before installing.

Uninstalling the script

You can simply delete the HDD Hibernation Fixer task task in DSM's Task Scheduler.

or, run

sudo python3 hiber_fixer.py --uninstall

synology_hibernation_fixer's People

Contributors

alexfromchaos avatar

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.