hdapm / Usage

What is hdapm?

Some models of hard drives exhibit annoying “clicking” or “chirping” noises, due to the drive heads being repeatedly loaded and unloaded when the drive is idle. This 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 could 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. By default, it sets the APM Level for all compatible ATA devices in the system.

If you only wish to run hdapm on specific drive(s), edit the program arguments in /Library/LaunchDaemons/hdapm.plist

hdapm takes two arguments: the device name(s) of the target drive(s) (e.g.: disk0, disk1), 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.

Note: Be careful not to change the permissions on the hdapm.plist file! It must be owned by root, and not globally writable, or launchd will not run it at startup.

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

Example:

hdapm disk0 disk3 max

Troubleshooting

To verify that hdapm has installed and run successfully, open the "Console" utility found in /Applications/Utilities. In "All 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] Set APM level to 0xfe: Success

Uninstalling

To remove hdapm from your system, run the "Uninstall hdapm" script included with the hdapm .dmg package. The following files will be removed:

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