[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

hdparm APM level when AC adapter is plugged/unplugged



Hi,

It seems /usr/lib/pm-utils/power.d/95hdparm-apm script from the hdparm package may be called when AC power adapter is plugged or unplugged (true/false arguments). I see that this script is invoked by /lib/udev/rules.d/85-hdparm.rules through /lib/udev/hdparm on boot or resume.

What package should be installed to call the script in response of change or power supply? Is that part of the script survived from the times of HAL? I expect some udev rule that acts for SUBSYSTEM=power_supply.

Perhaps laptop-mode-tools may be installed as an alternative solution and I will have once more tool that does something with disks. My worries are that it may interact with hdparm and udisks2 in some strange way.

The context of the question is the following. I added a hard disk drive and before I have created partitions I noticed regular sound of parking heads. It is udisks2 that decided to check SMART every 10 minutes for the disk with no mounted partition. The Toshiba disk reports 254 APM level (likely set by hdparm), active/idle state and parks heads with 2minutes timeout. I have not managed to read value of this timeout using hdparm or sdparm. As to udisks2, it is not possible to change polling interval, but likely it can be instructed to ignore particular disk without disabling SMART completely. The price is that udisks will ignore the disk completely. If I explicitly set standby (spindown) timeout <10min (e.g. by creating /etc/udisks2/<ID>.conf file) then disk is not waken up from standby state by udisks2 any more. However hdparm may distinguish on battery and connected to mains states, so it is more flexible than udisks.

Since I have dug into this problem, I decided to check whether disk APM value is adjusted when power state is changed after resume (during resume 128/254 values are chosen depending on on_ac_power script).

So I am disappointed by default behavior of tools, but I hope that I forgot to install some package that calls scripts from hdparm on connect/disconnect of power adapter.


Reply to: