hdapm / Usage

What is hdapm?

Some models of laptop hard drives exhibit annoying “clicking” or “clunking” noises, due to the drive heads being repeatedly loaded and unloaded when the drive is idle. This behavior can often be alleviated by setting the drive to the “maximum performance” APM level. Your drive must support this command for hdapm to work.

Caveats

Be aware that setting a drive to the “maximum performance” level may adversely affect battery life, depending on the drive’s firmware.

Configuration

The hdapm package installs the hdapm command-line utility and configures it to be run at startup automatically, for the primary hard drive device (disk0). For some configurations, such as systems with multiple drives, you may need to edit the program arguments in /Library/LaunchDaemons/hdapm.plist with your desired settings.

hdapm takes two arguments: the device name of the target drive (usually disk0), and the desired APM level. The APM level is a number between 1 and 254, inclusive. The exact meaning of each value depends on your drive’s firmware, but in general lower numbers mean more power saving and higher numbers mean more performance.

The following APM levels are pre-defined, and can be used in place of a numeric value:

Example:

hdapm disk0 max

Troubleshooting

To verify that hdapm has installed and run successfully, open the "Console" utility found in /Applications/Utilities. In "Console Messages", you should see output similar to the following:

30/06/2011 20:12:28 hdapm[62] disk0: WDC WD7500BPVT-22HXZT1
30/06/2011 20:12:28 hdapm[62] Setting APM level to 0xfe: Success

Uninstalling

To remove hdapm from your system, delete the following files:

/Library/LaunchDaemons/hdapm.plist
/usr/local/bin/hdapm