Spin Down Idle Hard Disks

Necessary tools:

Now, you need to edit your hdparm.conf to add entries for each of your drives.

Here’s an example of my setup.

You will note that I’m identifying the drives by their unique ID rather than simply using /dev/hdX or /dev/sdX, as device assignments can change between reboots. You can determine these values by looking at the output of this command.

It will give you output like this…

/dev/sdb would be identified by this in your /etc/hdparm.conf file.

You may also noticed that I have set Advanced Power Management to 127. This is the setting with the highest performance which still allows spindown, I’ve also told the drive to keep features over reset, in order to preserve the settings on a soft restart, and spindown delay has been set to 242 (1 hour).

Here’s the manpage description for more info.

NOTE: If you see an error like this, or some of your disks aren’t spinning down, it’s because your disk doesn’t support Advanced Power Management (APM). You can still spin them down with the hdparm -y, but this isn’t a viable solution, unless you want to roll a script to spin it down after a period of inactivity. Edit: I have created a script that will do just that. You can view it here.

Reboot for this to go into effect.

The above does put your disks to sleep, but I was having issues in that smartd (SMART monitor was checking the drives every 30 minutes. When this was happened, it would wake the disks up, basically never allowing them to go into standby. I have changed it to check every 2 hours, and to not spin the drive up if it is in standby. You can do so by making the following changes.

and add this to the options…

And, finally, if you don’t want to spin up idle hard drives, there’s one more file you need to edit.


Comment this line out


And add this below the commented out line.


One more reboot, and you should be on your way to drives that spin down, and all the energy savings associated with that.

If you’d like to check the status of your disks, you can view the current status like this.

It should output something like this if the disk is spun down.

Or, all of them at once like this where x is the starting disk and y is the end.


Here’s example output…


 

Zack

Zack

I love learning new things and trying out the latest technology.

Leave a Reply