Disable hard drive's APM

  • Hello. I have a usb hard drive connected to a raspberry pi 3 running LE 7.90.006. This hard drive parks its head after 2 seconds of inactivity. I can prevent that by connecting through ssh and typing 'hdparm -B 255 /dev/sda'. But after 20 or so minutes it spins down, and when i open something it spins up and starts parking its head again. Is there a permanent solution to this? I googled for a bit and found that adding 'apm = 255' to /etc/hdparm.conf should work, but there is no such file and i can't create it because the file system is read-only.

  • Place the hdparm command in the autostart.sh file. Any changes in /etc/something will be wiped with the next LibreELEC update.
    Depending on what is happening in the fore-/background, of course the hdd might spin up.

    On the other hand, just after 2 seconds of inactivity is pretty quick.

  • use

    Code
    hdparm -B 254 /dev/sda

    also, can you check the output of the following command after the disk goes to sleep to see if the value has changed?

    Code
    hdparm -B /dev/sda

    you can also try using

    Code
    hdparm -S 0 /dev/sda

    as this should disable the disk from sleeping at all.

    see, Tune Your Hard Disk with hdparm » Linux Magazine

  • I tried setting apm to 254 and after 20 minutes it parked its head and spinned down almost immediately. Then i checked with 'hdparm -b' and it said 128.
    I guess i could solve this problem by disabling sleep, but i'd rather not do that...