Comment 37 for bug 340014

Revision history for this message
Steve Langasek (vorlon) wrote :

In addition to CONTROL_HD_POWERMGMT, there are two other hdparm settings that may be set: CONTROL_HD_IDLE_TIMEOUT and CONTROL_HD_WRITECACHE, and of these, CONTROL_HD_IDLE_TIMEOUT is also set by default. I don't think this problem is limited only to APM calls, but that any hdparm calls contribute to triggering it.

You shouldn't need to patch your kernel to get a trace of apm calls, though; a simple wrapper script should do the job:

$ sudo dpkg-divert --add --local --rename /sbin/hdparm
$ cat | sudo tee /sbin/hdparm
#!/bin/sh

echo "called with args: $@" >> /var/log/hdparm.log
exec /sbin/hdparm.distrib "$@"
^D
$ sudo chmod a+x /sbin/hdparm
$

This should give you a log in /var/log/hdparm.log showing every invocation of hdparm on the system.