Saturday, March 29, 2014

Disabling HDD Spindown

Recently I've noticed that my HDD stops and starts too frequently. Not only has this affect on performance (access time) but it has negative impact to it's lifetime. So I've turned off Advanced power management (APM) function.

Not all HDDs support APM. You can show information with hdparm -I /dev/sdX

With one simple command, you can adjust APM level:

hdparm -B255 -S180 /dev/sdX

This disables APM (-B255) and sets timeout for HDD spin down (-S180), which has no effect here because of disabled APM.
After this command, HDD won't spin down.

To make this changes permanent I've created udev rule /etc/udev/rules.d/11-hdparm.rules, so the setting will apply after reboot:
ACTION=="add", SUBSYSTEM=="block", KERNEL=="sdb", RUN+="/usr/bin/hdparm -B255 -S180 /dev/sdb"

No comments:

Post a Comment