hdparm on OS X

Solution 1:

pmset

pmset can manipulate power management settings, for example:

sh-3.2$ pmset -g | grep disksleep
 disksleep            10
sh-3.2$ sudo pmset disksleep 0
Warning: Idle sleep timings for "Battery Power" may not behave as expected.
- Disk sleep should be non-zero whenever system sleep is non-zero.
sh-3.2$ pmset -g | grep disksleep
 disksleep            0
sh-3.2$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.8.2
BuildVersion:   12C60
sh-3.2$ 

pmset(1) OS X Manual Page

EFI and SATA

https://discussions.apple.com/message/11856660#11856660 (2010-07-07) reminds me:

… Engineering has provided the following information:

This behavior is not the result of OS level disk spindown commands. There is an EFI change for SATA bus speed; and the suggested workaround is to run hdapm to set a new power management level on the disk itself.

This isn't an OS power management behavior, it's a tricky interaction between device firmware and EFI's configuration of the SATA interface. We commission drives from our vendors with different behaviors than the drives available generally on the market, and that is why the generic replacement does not support the features as you expect. …

(Side note: an Apple Support Communities bug may cause the wrong set of messages to appear. If that bug bites, then instead browse to the 2010-07-07 point in the topic.)

hdapm

http://mckinlay.net.nz/hdapm/

A Mac OS X command line utility for setting the power management (APM) level for ATA hard drives.

It can be used to eliminate "chirping" or "clicking when idle" noises in some HDDs.

Compatibility

  • OS X 10.5 or higher.
  • ATA/SATA hard disk with APM support.
  • Does not work with external USB or Firewire drives. …

 

… (Aug 25, 2012) version 1.2. …

SpindownHD

From past use of tools from Apple Developer, I set aside a copy of SpindownHD.app 4.6.2 (227.9) Copyright © 2003-2005 Apple Computer, Inc., part of the old CHUD (Computer Hardware Understanding Developer) tools – apparently OK for polling. However: as some of the KEXTs from that period are incompatible with modern versions of the OS, I don't know whether it's sane to use this app for sleep settings (for all disks).

2012-10-26 screenshot of old SpindownHD.app

Solution 2:

http://missig.org/julian/projects/macosx/

"diskutil - A whole set of utilities like fsck, fdisk, tune2fs, and hdparm combined."

http://en.wikipedia.org/wiki/Disk_Utility

"Disk Utility functions may also be accessed from the Mac OS X command line with the diskutil and hdiutil commands."

There seems to be no port of hdparm for OSX unfortunately.