PDA

View Full Version : [SOLVED] How to spin down, unused Internal Disks?



mikodo
March 16th, 2012, 12:15 AM
Hi,

I am thinking of putting a couple of extra internal HD's, in my computer. I would only do that, if there is a way to have them spin down, when not using them.

Is there a way to do this, outside of yanking the power lines?

Thanks.

mikewhatever
March 16th, 2012, 12:28 AM
Use 'hdparm'. It's a command line tool for disk power management. Let's say, one of the drives you add is designated as /dev/sdb, then, to spin it down after 10 minutes, you'd use the following as admin:



hdparm -B 127 -S 120 /dev/sdb


-B stands for advanced power management, with values from 1 - 127 permitting spindown. -S is the spingdown timeout, in the example above - 120x5=600 seconds, or 10 minutes.

Check out 'man hdparm' for more info.

To automate the procedure, just add a line for each HDD to /etc/rc.local.

mikodo
March 16th, 2012, 01:11 AM
Use 'hdparm'. It's a command line tool for disk power management. Let's say, one of the drives you add is designated as /dev/sdb, then, to spin it down after 10 minutes, you'd use the following as admin:



hdparm -B 127 -S 120 /dev/sdb
-B stands for advanced power management, with values from 1 - 127 permitting spindown. -S is the spingdown timeout, in the example above - 120x5=600 seconds, or 10 minutes.

Check out 'man hdparm' for more info.

To automate the procedure, just add a line for each HDD to /etc/rc.local.Sounds simple enough.

Can you give me an other example of entering a line, for automating the proceedure:


gksu gedit /etc/rc.local *OR*

sudo nano /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0Thanks.

mikewhatever
March 16th, 2012, 02:55 AM
The lines would look very similar, with only the hdd designations changing:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
hdparm -B 127 -S 120 /dev/sdb
hdparm -B 127 -S 120 /dev/sdc
hdparm -B 127 -S 120 /dev/sdd
exit 0

If you want a time out other then 10 minutes, modify the -S value accordingly.

mikodo
March 16th, 2012, 03:17 AM
The lines would look very similar, with only the hdd designations changing:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
hdparm -B 127 -S 120 /dev/sdb
hdparm -B 127 -S 120 /dev/sdc
hdparm -B 127 -S 120 /dev/sdd
exit 0If you want a time out other then 10 minutes, modify the -S value accordingly.Thank you, for the hand-holding!

tsucol11
March 16th, 2012, 04:18 AM
thank you

Brian