Hi all. I've been noticing for some time that the hard drives on all my machines, whether desktop or notebook, are being set to an APM Level of 128 on boot and an excessive spin-down interval of every few seconds. For months I've been lazy about this matter and resetting the APM manually after login with hdparm, but now I'd like to fix this properly, so I started investigating.
There's been much discussion about this issue on the Ubuntu and Arch sites for at least a year or two, so it's neither a new or unique problem to Mageia 4 or my use case. Many proposed solutions involve writing rc.local scripts or udev hooks, but in our existing /usr/lib[64]/pm-utils/power.d/harddrive script it says that hdparm should already be configured for optimal performance (-B 254) with spin-down disabled (-S 0) under AC power, and for hyper-aggressive power management (-B 1) with a 30-second spin-down interval (-S 6) on battery. While I'm not sure I agree the battery settings are completely sane, the AC ones are fine IMO. The thing is, as I said above, on boot the drives on all my machines always start out with an APM Level of 128 and an unknown but extremely short spin-down interval. Also, unplugging and plugging my notebooks onto AC power has no effect on the drives' APM whatsoever. This suggests that the /usr/lib[64]/pm-utils/power.d/harddrive script is never run.
So what's supposed to run it and when? Is the upower.service supposed to utilize the pm-utils package or replace it? UPower is poorly documented, and after a couple of hours of googling I'm just baffled. Much of the advice and explanations either conflict or are potentially outdated. Under systemd, I'm guessing a custom udev hook would be the way to go, but I have no idea. What's the best-practice solution? Personally, I'd be happy if the pm-utils scripts (at least the harddrive one) were respected.
As always, any help or advice appreciated.