Get APMtimer at SourceForge.net. Fast, secure and Free Open Source software downloads

APMtimer

Quick links

SourceForge project page Download files Get support

Description

APMtimer provides a Linux/Unix utility that can permanently Disable, Get, or Set the value of the APM timer found in recent Western Digital 2.5 WD*PVX Hard Disks where the APM setting defaults to 0x60 after a power cycle.

It may be used in conjunction with the official wdidle3.exe proprietary program or Christophe Bothamy's Idle3-tools to control your WD Hard Disk's Intellipark timer.

A power off/on cycle to the hard disk is required for the new settings to take effect. If the APM timer is disabled, the hard disk's default APM level should change from 0x60 to 0x80 after a power-cycle.

APMtimer is an independent project, unrelated in any way to Western Digital Corp. or Christophe Bothamy.

WARNING : THIS SOFTWARE IS EXPERIMENTAL AND NOT WELL TESTED. IT MIGHT VOID YOUR WARRANTY WITH WESTERN DIGITAL. USE AT YOUR OWN RISK!

IF YOU ARE UNSURE OR DO NOT WANT TO MAKE ANY PERMANENT CHANGE TO YOUR HARD DISK, USE THE "hdparm -B " COMMAND INSTEAD!

IMPORTANT : You should always note down the default value of the APM timer before making any changes so that you can undo the changes in the future.

Origin

Recent Western Digital 2.5" Hard Disks include the Intellipark feature that parks the Hard Disk's head when it is not in use. The time required to trigger the Intellipark feature is believed to be defined by the idle3 and APM timers.

The default timer setting might not be perfect for everyone. It could also result in an increase to the SMART Load Cycle Count value (SMART attribute #193).

See Nasty Intelli Park on WD Scorpio Blue 1T 2.5" and Anyone managed to permanently disable Advanced Power Management in WD10JPVX ?

If you have a Western Digital JPVX or LPVX Hard Disk, you can check the SMART Load Cycle Count information with the following command :

$ sudo smartctl -A /dev/sda | grep "^193"
193 Load_Cycle_Count        0x0032   253   253   000    Old_age   Always       -       31337
If the Load Cycle Count exceeds 1000, your WD hard disk is probably parking at a rate faster than what is ideal for your Operating System. This could be due to either the idle3 feature, new APM feature, or both.

To check if your WD Hard Disk has an APM level of 0x60, run the following command :
$ sudo hdparm -I /dev/sda | grep "Advanced power"
     Advanced power management level: unknown setting (0x0060)
If the APM is at level 0x0060, it probably has the APM timer set.

Syntax

apmtimer [options] /dev/device

Examples

Get APM timer raw value

# apmtimer -g /dev/sda

Disable APM timer

# apmtimer -d /dev/sda

Set the APM timer to 10.0s

# apmtimer -s 10.0 /dev/sda

Compatibility

APMtimer should be compatible with all recent Western Digital HDD driven by a real SATA controller.

Compatibility with SATA-to-USB adapters has not been tested.

Since APMtimer uses SMART ATA commands to manipulate the APM timer, it should work if SMART information can be read from your hard disk.

WARNING

The APM timer appears to be a power-on only setting. That means that the hard disk needs to be powered OFF and then ON to use the new default setting.

Download

Source code and releases can be found on the SourceForge project pages.

Compilation / Installation

After downloading the tarball, for example the 1.0 release (apmtimer-1.0.tar.gz), uncompress it :

$ tar zxvf apmtimer-1.0.tar.gz
Change to the source directory, and compile the code :
$ cd apmtimer-1.0
$ make
You should get the apmtimer executable :
$ ls apmtimer
apmtimer
$ ./apmtimer -V
APMtimer v1.0
And run it with root permissions to get or set the APM value :
$ sudo ./apmtimer -g /dev/sda
You can optionally install the APMtimer utility to the /sbin directory
$ sudo make install
Please note that you only need to run apmtimer once on each WD Hard Disk as the APM timer setting change is permanent.

Author

This utility is brought to you by Khong How Yu.

It was modified from Christophe Bothamy's idle3-tools project.

Low level ATA I/O is done using the sgio.c file of the hdparm project.

License

The APMtimer project is released under the GNU GPL v3.

Thanks

This utility would not have been possible without the invaluable mentoring and guidance given by Franc Zabkar (fzabkar).

Christophe Bothamy for developing the idle3-tools.