Spin Down Idle Hard Disks Without /etc/hdparm.conf

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.

Note

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.

Zack

Zack

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

You may also like...

Leave a Reply