Spin Down Idle Hard Disks Without /etc/hdparm.conf3 min read

I’ve had a few people ask me over the years about spinning down disk that don’t have Advanced Power Management or otherwise can’t be spun down by hdparm. The following is a way to spindown disks without using hdparm’s config file.
Here is a brief shell script to spindown idle hard drives.

and paste this in…

What this script does it writes the output of /proc/diskstats to the ramdisk via cronjob. When it runs the next time, it will use the diff command to identify disks that haven’t been read from or written to in that time period, and then will spindown those disks.

Some users have reported that using hdparm -C wakes up their disks. If you are in that boat, replace this line…

with this…

You will want to create a cronjob to run this periodically, here is an example.

and paste…

This will check your disks every 30 minutes and will spin them down if they are idle.


You will want to verify that smartmontools is setup to not wakeup idle disks, or every 30 minutes, it will be spinning you disks back up to check them.



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

You may also like...

2 Responses

  1. Dulanic says:

    So if I wanted USB drives to spin down, is it as simple as removing the code to identify USB drives? I ask since I have a 4 drive external drive enclosure that is USB 3.0. I’d use eSata but my built in eSata doesn’t support Port Multiplication.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.