Solution:
hd-idle is the way to go (if you read their README, they explain that most drives don’t support idle timers)

I’ve been looking into spinning down the drives of my NAS, as I use it infrequently and that brings power drain down from ~30W to ~17W.

Problem is, hdparm -S doesn’t seem to do anything for these particular drives: if I set it and wait for the appropriate amount of time (eg. 5 seconds if set to 1) the drives are still reported as “active/idle” and power drain doesn’t go down.

Both hdparm -y and hdparm -Y work fine, but I don’t seem to be able to find settings for them in tlp (probably because they are commands rather than settings?).

Besides the caveats about disks living longer if they are kept spinning, are there reasons why I shouldn’t setup a cron job (well, a systemd timer) that runs hdparm -Y every 10 minutes? (for example, could hdparm -y cause errors if run while the drive is being backed up?)

PS: According to hdparm’s manpage, -y puts the drive standby mode while -Y puts it into sleep mode. Considering that in my case power drain seems the same either way, should I prefer one or the other?

  • InnerScientist@lemmy.world
    link
    fedilink
    arrow-up
    11
    ·
    edit-2
    1 month ago

    Use -B instead.

    Sets Advanced Power Management feature. Possible values are between 1 and 255, 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. A value of 255 completely disables the feature.)

    • ReversalHatchery@beehaw.org
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 month ago

      hd-idle is the solution. it’s strictly better than the HDDs own feature, because if you have some system monitoring software that queries your disk stats every minute, that will always reset that timer. hd-idle is smarter than that.

  • ReversalHatchery@beehaw.org
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 month ago

    Besides the caveats about disks living longer if they are kept spinning,

    I think that’s not necessarily true. I think spinning 24/7/365 has its downsides too, higher temperatures and others I’m less certain about.

    are there reasons why I shouldn’t setup a cron job (well, a systemd timer) that runs hdparm -Y every 10 minutes? (for example, could hdparm -y cause errors if run while the drive is being backed up?)

    because you’ll often shut it down while someone would be using it. and then it can spin up immediately. the processes accessing it would probably hang for half a minute or such.

    there is a better solution, hd-idle, as said in the other response

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 month ago

    Does the job get suspended if tasks are being done on the drive or will the task stall with the command being fired then the drive wakes up again defeating the purpose of the job?

  • nanook@friendica.eskimo.com
    link
    fedilink
    arrow-up
    2
    ·
    1 month ago

    When you spin up the drive, the motor has to overcome the mass of the disks to bring them up to speed, requiring more torque, current, and wear, than just keeping them at that speed. On the other hand, bearings don’t wear out at zero RPM. Bearings go, motor goes, either way drive is dead. Regarding bearings ALWAYS mount drives so that they are horizontal, this results in minimal bearing wear and load.

    • MangoPenguin@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 month ago

      The motors are brushless, so no wear happens during spin-up from the extra current other than a little more heat for a few seconds.

      • nanook@friendica.eskimo.com
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        1 month ago

        @MangoPenguin Same thing that happens to your car motor when you slam the accelerator from a dead stop rather than gradually accelerating and maintaining a steady speed. Everyone knows stop-and-go traffic is hard on cars, disk drives too.

        • MangoPenguin@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          3
          ·
          1 month ago

          Car engines have connecting rods and all kinds of extreme side forces on bearings that get stressed under high load. Brushless motors do not have any of those things, just a rotational bearing that doesn’t experience any more load on startup vs constant speed.

          • Amju Wolf@pawb.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 month ago

            The startup is absolutely more stressful for the motor. It’s a period of high current that also creates hotspots in the windings and such. It’s certainly not great for the motor.

            • MangoPenguin@lemmy.blahaj.zone
              link
              fedilink
              English
              arrow-up
              1
              ·
              1 month ago

              Hotspots won’t hurt anything unless they get too hot and damage the coating on the windings, I would assume the manufacturer is aware of that and designed the startup current so it’s safe.

  • bloodfart@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    1 month ago

    Hey I see that you found hd-idle.

    Last time I tried to use it it wasn’t compatible with smartmon.

    I would take smartmon over spin down every day of the week.

    I’m gonna go out on a limb and assume the reason you have this problem with power is that you’re running a zfs/md-raid 5 or whatever. It may be a good idea to get away from that configuration. When you write a file to a 3 disk pool with parity, all three drives spin up. The details are a whole nother can of worms but the way that operating systems, busses and hbas interact with disks make this even worse.

    I got away from that situation with a mergerfs/snapraid setup where my disks are jbod and writing a file to the pool only spins up one disk (with some caveats) and parity calculation is done at night as a snapshot all at once.

    I do not think this saves power, although my power use has been very low in this configuration. I do think this saves drives, because snapraid is decently judicious with spin up/spin down work, amassing all the changes first then calculating what to put where and doing that all at once.

    If your primary concern is power use and hard disk life, consider a ssd pool. The density and power consumption are why datacenters switched to them and why 3.5 racks are so cheap now in comparison.