Giter VIP home page Giter VIP logo

Comments (8)

adelolmo avatar adelolmo commented on June 29, 2024 1

@V33m explained exactly how hd-idle behaves in this case.
hd-idle monitors /proc/diskstats in order to evaluate disk activity. If smartmontools spins up the disk without modifying reads/writes in /proc/diskstats hd-idle won't notice that change. Therefore hd-idle will only spin down the disk after a change in /proc/diskstats.
I don't see how to workaround this problem.

from hd-idle.

V33m avatar V33m commented on June 29, 2024

Adelolmo probably has a better answer, yet I don't think it's possible given how hd-idle detects if a disk is spinning or not. Regardsless, this is a corner case as one does not very often make a smartmoontool report. In addition to that, when you actually use the disk next time afterwards, the internal state will switch and hd-idle will detect when the disk can be spun down. So, the detection issue is only relevant for the period between when the disk is spun up with smartmoontool -x and before you read/write to the disk next time

from hd-idle.

nickcmaynard avatar nickcmaynard commented on June 29, 2024

Thank you both - that's a good explanation.

I wonder - would there be overhead/consequences from periodically (say, every configurable X seconds) reissuing the standby command if a disk "should be" spun down according to hd-idle's internal state?

It's not perfect and arguably not particularly elegant, but it would compensate for this edge case.

from hd-idle.

nickcmaynard avatar nickcmaynard commented on June 29, 2024

<deleted a comment that muddied the water - created #20 instead>

from hd-idle.

V33m avatar V33m commented on June 29, 2024

Spinning up/down a hard drive is quite hardware tear problematic when done frequent, and every time you reissue a standby command you either spin up or down the disk, regardless of the disk's previous state. I would highly advice against that. I think I would rather fork smartmoontool, build your own version where you change the code of smartmoontool to do a simple seek at root of the drive when making the report. That would fix this issue as smartmontool will change /proc/diskstats.

Out of curiosity, why do you need to make smartmoontool reports so often? Isn't it enough with one report per harddrive and that's it?

from hd-idle.

marki555 avatar marki555 commented on June 29, 2024

You have 2 options regarding smartmontools:

  1. When you run smartctl from cron for example, include any action which would increase the counters (list directory, use dd, ...)
  2. If using smartd to continously monitor the disk state, use smartctl's option "-n STANDBY" which will prevent smartctl/smartd spinning up the disk

from hd-idle.

graemev avatar graemev commented on June 29, 2024

For most folks hdparm -C would do the job. Sadly no use to me (on QNAP) since there it's compiled with debug on so it writes to syslog and hence to disk (spinning it up)

from hd-idle.

devZer0 avatar devZer0 commented on June 29, 2024

When it's cause by smartd, you can use

/dev/disk/by-id/ -d ignore
before
DEVICESCAN statement
in smartd.conf
to exclude the disk from being queried by smartd

see
https://www.smartmontools.org/ticket/1390#comment:2

from hd-idle.

Related Issues (20)

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.