You are not logged in.
Pages: 1
Topic closed
Hi everyone,
I hope everyone is well. I am having problems setting my spindown time with Hdparm.
I have a laptop with both SSD and HDD, and the default arch APM setting is APM = 1 which spins down my HDD after a few seconds at idle. To avoid that I followed the advice on the above page and used this udev rule:
[root@S530]# cat /etc/udev/rules.d/69-hdparm.rules
ACTION=="add|change", KERNEL=="sd[a-z]", ATTRS{queue/rotational}=="1", RUN+="/usr/bin/hdparm -B 150 -S 150 /dev/%k"as well as this script to restore the setting after wakeup :
[root@S530]# cat /usr/lib/systemd/system-sleep/hdparm.sh
#!/bin/sh
case $1 in post)
/usr/bin/hdparm -150 -S 150 /dev/disk/by-uuid/e3e25037-f361-416d-a5da-666b7a65395b
;;
esac
[root@S530]# chmod a+x /usr/lib/systemd/system-sleep/hdparm.shThese do not seem to work. After boot, the drive never goes to sleep, and after resume it goes to sleep immediately and APM is reset to 1... Some drives do not respect hdparm settings, but when I manually set hdparm -S it works, so I suppose that it has to do with my rules/script.
Does anyone see anything wrong with these rules ? I just installed Arch and have no previous experience of udev rules or systemd
Thanks for your help !
(initially posted my question here, which is an interesting read even though it wasn't the right place)
Last edited by Cvlc (2020-04-04 11:17:42)
Offline
Hi, it's easier for you to use TLP and it has GUI too.
Offline
Thanks very much, will try it out it seems a lot easier, and has different settings for on AC/ BAT. Will report here whether tlp's APM settings are respected.
[edit] works perfectly, thanks very much, great tip !
for reference though, can anyone point me to where I was wrong in the above steps ?
Thanks very much and have a great sunday
Last edited by Cvlc (2020-04-05 13:09:00)
Offline
You missed -B
/usr/bin/hdparm -150 -S 150 /dev/disk/by-uuid/e3e25037-f361-416d-a5da-666b7a65395bOffline
Indeed ! well that explains one, so the setting after resume should work now (I think it did originally, I must have messed it up when testing different combinations)
In the end TLP doesn't really work as I thought (previous post). it sometimes works and sometimes doesn't.. and it also spins up the drive when I plug/unplug the AC cable (probably to set the new parameters).
In the end it's about the same, the B parameter (DISK_APM_LEVEL for tlp) seems to work but when combined with the S parameter it doesn't always work. I might try a combination of TLP for DISK_APM_LEVEL and hd-idle for spindown time.. but it doesn't seem like a very nice way to do it.
Offline
I think the best solution is TLP. At least it appeared just to replace dancing with scripts. Install tlpui and it is better to read the settings.
Offline
You have to use special value `keep` so that tlp docen't apply the values on power source change. https://linrunner.de/tlp/faq/disks.html … vice-versa
Offline
Moderator Note
Please look at the date of the last post before posting something new.
See https://wiki.archlinux.org/title/Genera … bumping%22
Closing this old thread
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Pages: 1
Topic closed