Desktop hard drives often have fairly aggressive APM (advanced power management) settings configured by default.
Check your current drive's APM configuration (adjust device as needed):
hdparm -I /dev/sda |grep "Advanced power management level"
If you install 'desktop' hard drives in a server, you probably want to disable APM. This might give you longer drive life at the expense of slightly higher power utilization.
Here we disable APM on sda
, sdb
, sdc
and sdd
:
for x in [abcd]; do hdparm -B 255 /dev/sd$x; done
Here we add that command to rc.local
:
Here we disable APM on sda
, sdb
, sdc
and sdd
at startup:
cat << EOF >> /etc/rc.local # # Disable power management on all hard drives # for x in [abcd]; do hdparm -B 255 /dev/sd\$x; done EOF
The backslash keeps BASH from expanding the variable into rc.local
and would be omitted if entering the command at the bash prompt.