USB HDD always spin down after few minutes

  • Hi.

    I'm using version 13 night builds on my GMKtec G3 Plus (version 12 doesn's work on my box).

    I have an USB hard drive connected via USB and have no problem in general but when I pause a movie or anything I'm watching for just few minutes, HDD spins down.

    I tried to use hdparm in autostart.sh with this command: "hdparm -S 0 /dev/sda2" and also "/usr/bin/hdparm -S /dev/sda2" but with no luck: if I pause my watching, HDD spins down, always.

    If I open a shell (ssh) and run the command "hdparm -S 0 /dev/sda2" when HDD is down then it resumes so, I guess, the command is correct but when inserted in autostart.sh it doesn't work.

    If I shutdown LibreElec keeping HDD on it never spins down so I guess it's LibreElec that somehow spins HDD down in some way.

    What am I doing wrong? Is there anything else I can do to avoid the spinning down of my HDD after few minutes?

    Thanks a lot,

    Michele.

    Edited 2 times, last by myksto (July 7, 2025 at 4:20 PM).

  • Update the script to use /dev/sda and see if that resolves the issue? - the hdparm command targets a disk device and /dev/sda2 is a partition on a disk, not the disk.

  • I'll give it a try late in the evening.

    The thing that looks stange to me is the fact that if I lunch the command "hdparm -S 0 /dev/sda2" from an SSH shell when the HDD is sleeping then it start to spin up immediately.

    Thanks a lot for your advice.

  • Not working, modified script in "hdparm -S 0 /dev/sda", rebooted and after few minutes HDD spins down.

    I noted one thing, if I launch the command "hdparm -S 0 /dev/sda" from an SSH shell HDD spins UP and "Setting StanBy to 0 (off)" appears on console but after few minutes HDD spins down again.

    I really don't undestand what's going on. This is the third HDD I try and with all of them I have the same result. This must something inside LibreElec or its operative system.

    Any other idea?

  • I have an USB hard drive connected via USB and have no problem in general but when I pause a movie or anything I'm watching for just few minutes, HDD spins down.

    Most users prefer that behavior. So in general it's not a bug, but a feature. :saint:

    I tried to use hdparm in autostart.sh with this command: "hdparm -S 0 /dev/sda2" and also "/usr/bin/hdparm -S /dev/sda2" but with no luck: if I pause my watching, HDD spins down, always.

    The thing that looks stange to me is the fact that if I lunch the command "hdparm -S 0 /dev/sda2" from an SSH shell when the HDD is sleeping then it start to spin up immediately.

    The above facts result in the conclusion that your HDD firmware does the energy management, not LE.

    • The HDD firmware spins down whenever idle in mounted mode.
    • The HDD firmware takes hdparm as an abstract task, and spins up without further command interpretation.