You are not logged in.
Hey guys,
so basicly my problem is described in the subject.
I followed the wiki for setting hdparm values on boot and on resume after sleep. But every time I boot or resume from sleep the value is set back to 128.
I know it worked when i tried Arch a few years ago but now I don't know where to look.
Thanks for help in advance!
Last edited by a2r (2015-10-31 12:39:55)
Offline
Resume works with:
systemd 226-1
hdparm 9.48-1
Did you remember to make the script executable? If so, maybe check $ man systemd-suspend.service to see if anything has changed or make the script do something else for verification, like:
#!/bin/sh
date >> /tmp/resumedLast edited by Pingwinski (2015-10-30 03:15:13)
Offline
Thanks for the reply.
I did make it executable, but why should this change the man page?
I did the check if the script gets run.
It does print the date to /tmp/resumed, once before sleep once after.
Then I put "hdparm -B255 /dev/sda" above the echo, the date still gets printed, the value for hdparm does not get set.
Is there maybe a place from where hdparm is getting called again AFTER the script in /usr/lib/systemd/system-sleep and thus sets it to 255 and then back to 128?
Offline
Since my systemd isn't the latest version I wanted to rule out any changes there.
If the hdparm command working manually (checked with $ hdparm -B <dev>) is copy-pasted to systemd files (to rule out mistypes) then I agree something else is happening here. The only service calling hdparm that I know of is laptop-mode-tools.
Sorry if I come off as mistrusting, just want to be thorough ![]()
You could create a proxy script for hdparm to log when it's executed:
# mv /usr/bin/hdparm /usr/bin/hdparm.orig
# vim /usr/bin/hdparm#!/bin/sh
LOGFILE=/tmp/hdparm_executed
echo "$(date)
hdparm args: $@
" >> $LOGFILE
/usr/bin/hdparm.orig $@# chmod +x /usr/bin/hdparmAfter testing, don't forget to:
# mv /usr/bin/hdparm.orig /usr/bin/hdparmEdit: fixed atomic output in the script
Last edited by Pingwinski (2015-10-30 17:10:43)
Offline
Okay, I did your next trick (btw. I'm learning some nifty tricks from you, thankss for that
)
Here is the output:
Fr 30. Okt 20:31:48 CET 2015
hdparm args: -I /dev/sdaFr 30. Okt 20:31:48 CET 2015
hdparm args: -B 254 /dev/sdaFr 30. Okt 20:31:48 CET 2015
hdparm args: -B255 /dev/sdaFr 30. Okt 20:31:48 CET 2015
hdparm args: -B255 /dev/sdaFr 30. Okt 20:31:55 CET 2015
hdparm args: -B255 /dev/sdaFr 30. Okt 20:31:55 CET 2015
hdparm args: -I /dev/sdaFr 30. Okt 20:31:56 CET 2015
hdparm args: -B 128 /dev/sdaFr 30. Okt 20:32:05 CET 2015
hdparm args: -B /dev/sda
One can see, that the value gets set before sleep a few times and then again AFTER resume to 255 and a second later to 128. Is there a way to see who called that?
I also looked if laptop-mode-tools is installed, it's not.
Offline
I guess you can find the spooky actor in some systemd unit file. Before trying to get the calling process via scripting* (which might just turn out to be ''systemd", idk) try searching directories containing unit files and grep for "hdparm". Something like this:
$ find /etc/systemd/ /usr/lib/systemd/ -type f -exec grep hdparm '{}' + 2> /dev/nullIf you find anything other than your own script please check what package(s) owns the file(s) with pacman:
$ pacman -Qo <files>This command searches and passes findings to pacman directly:
$ find /etc/systemd/ /usr/lib/systemd/ -type f -exec grep hdparm '{}' + 2> /dev/null | cut -d':' -f1 | xargs pacman -QoMaybe there's a config file for the spooky actor, which could be a cleaner way of calling hdparm than having one's own script.
* If you want to try to get the parent process from the script maybe this'll work:
http://www.linuxquestions.org/questions … pt-526384/
http://stackoverflow.com/questions/3586 … using-bash
Good luck, don't forget to report back if solved!
Edit:
Just remembered something I read in the man page for systemd-suspend.service:
"If applications want to be notified of system suspend/hibernation and resume, there are much nicer interfaces available."
So the above approach might not yield if the spooky actor is something more sophisticated like a power management service (in gnome?).
Edit #2:
udisks can modify spin-down aswell:
https://bbs.archlinux.org/viewtopic.php?id=181977
Edit #3:
Gnome disk settings:
http://askubuntu.com/questions/39760/ho … 876#387876
This is why I'm on fluxbox ![]()
Last edited by Pingwinski (2015-10-31 00:51:45)
Offline
DAAAAAAAAAAAAAAAAARGH!!!!
I found it. TLP set the values to 128. I changed them in /etc/default/tlp now everything works, I don't even need the systemd units and script anymore.
Your link in Edit #2 helped me find it.
Changed
DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="128 128"to
DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="254 254"Thanks alot for the help! How do I tag a thread as solved
?
Offline
Nice to hear! ![]()
It sucks having to worry about drive health. Took me a couple of hundred thousand load cycles before I researched the weird behaviour and sounds. Spin-down time is either ~6 seconds or OFF on my ST1000LM024 HN-M101MBB!
As for marking as solved, I think manually editing the first post is the way to go.
Offline
For me, it was first a paranoia that my harddrive would die in a year if it spins down that fast. Now that harddrive is 5 years old and never complained about anything. That laptop is now just a secondary machine I take with me to work on when I'm not at home, so I don't care about the drive anymore (in fact, when it dies I put in an SSD, so I kind of want it to happen
) but that clicking is really anoying me.
Again, thanks for the help. May the tux be with you!
Offline