diff options
-rwxr-xr-x | etc/rc | 3 | ||||
-rw-r--r-- | etc/rc.disable_hdd_apm | 10 |
2 files changed, 13 insertions, 0 deletions
@@ -80,6 +80,9 @@ if [ ! "$PLATFORM" = "cdrom" ] ; then fi fi +# Disable APM on ATA drives. Leaving this on will kill drives long-term, especially laptop drives, by generating excessive Load Cycles. +/etc/rc.disable_hdd_apm + if [ ! "$PLATFORM" = "jail" ]; then # Check to see if a compact flash mountpoint exists # If it fails to mount then run a fsck -fy 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 |