Western Digital EPC(Extended Power Condition) control tools for Linux.
This tool is only tested on Western Digital HC320
disk, but may work in other Western Digital disk supported EPC
.
All query function is 99% safe, unless your disk translate those command into some wrong WRITE
command.
USE AT YOUR RISK.
There was a power management mechanism called APM
- Advanced Power Management
in the late 90s.
It is supported by almost all hard drives.
APM defines a APM Levels
from 0 - 255.
level | description |
---|---|
0 | Reserved |
1 | Minimum power consumption with Standby |
2 - 127 | Intermediate power management levels with Standby |
128 | Minimum power consumption without Standby |
129 - 254 | Intermediate power management levels without Standby |
254 | Maximum performance |
255 | Reserved |
where standby
means spin down.
This is the latest power management standard in hard drives, it's usually supported on enterprise-grade hard drives (some newer hard drives don't support APM, EPC is used exclusively).
EPC defines two main state:
- PM1: Idle state
- Idle_a: drive ready, not performing I/O; drive may power down some eletronics to reduce power without increasing response time.
- Idle_b: spindle rotation at 7200 with heads unloaded.
- Idle_c: spindle rotation at low RPM with heads unloaded.
- PM2: Standby state
- Standby_y: same as Idle_c in Seagate and WD
- Standby_Z: Actuator is unloaded and spindle motor is stopped. Commands can be received immediately.
a SATA state sleep
, same as Standby_z but require soft reset or hard reset to return to mode Standby_Z.
Current tools like hdparm
can not update EPC settings like timer, enable or disable, so this tool came up.
get current power mode
wdepc -d /dev/sda check
Output:
idle a
Enable EPC and disable APM.
The APM is disabled automatically and can not be controlled.
wdepc -d /dev/sda enable
Disable EPC, but doesn't re-enable APM.
You must enable APM MANUALLY on demand.
wdepc -d /dev/sda disable
Show EPC settings, include timer, state
wdepc -d /dev/sda info
Output:
* = enabled
All times are in 100 milliseconds
Name Current Timer Default Timer Saved Timer Recovery Time Changeable Savable
Idle A *20 *20 *20 1 true true
Idle B *6000 *6000 *6000 10 true true
Idle C 0 0 0 40 true true
Standby Y 0 0 0 40 true true
Standby Z 0 0 0 150 true true
wdepc -d /dev/sda set <idle_a | idle_b | idle_c | standby_y | standby_z >
Set specific mode timer.
wdepc -d /dev/sda set-timer <mode> <timer> --save --enable true
If --save
present, save the timer setting even after reboot.
--enable
controls if the timer is enabled.
Enable or disable a specific mode.
wdepc -d /dev/sda set-state <mode> --save --enable true
If --save
present, save the state setting even after reboot.
--enable
controls if the power state is enabled.
Restore a specific power mode setting.
wdepc -d /dev/sda restore -d -s <mode>
If --default
present, set current setting to default, else set current setting to saved setting.
If --save
present, save current setting.