summaryrefslogtreecommitdiffstats
path: root/etc/rc.disable_hdd_apm
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-01-30 16:24:58 -0500
committerjim-p <jimp@pfsense.org>2012-01-30 16:40:03 -0500
commit51f4e64b319afe3609b6e3d66e7467fa4ba3dcc2 (patch)
tree2dd20259f20f555599caf7f7f7e5bdc14961402a /etc/rc.disable_hdd_apm
parent89bbb204ad58c4d0250ebabf34ebec1996a53088 (diff)
downloadpfsense-51f4e64b319afe3609b6e3d66e7467fa4ba3dcc2.zip
pfsense-51f4e64b319afe3609b6e3d66e7467fa4ba3dcc2.tar.gz
Add a small script to disable APM on ATA drives if they claim to support it. Leaving this on will kill drives long-term, especially laptop drives, by generating excessive Load Cycles.
The APM bit set will persist until the drive is power cycled, so it's necessary to run on each boot to be sure.
Diffstat (limited to 'etc/rc.disable_hdd_apm')
-rw-r--r--etc/rc.disable_hdd_apm10
1 files changed, 10 insertions, 0 deletions
diff --git a/etc/rc.disable_hdd_apm b/etc/rc.disable_hdd_apm
new file mode 100644
index 0000000..58f3734
--- /dev/null
+++ b/etc/rc.disable_hdd_apm
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+ATAIDLE=/usr/local/sbin/ataidle
+for i in /dev/ad?; do
+ SUPPORTED=`${ATAIDLE} ${i} | grep "APM Supported" | awk '{print $3;}'`
+ if [ "${SUPPORTED}" = "yes" ] ; then
+ echo Disabling APM on $i
+ ${ATAIDLE} -P 0 ${i}
+ fi
+done
OpenPOWER on IntegriCloud