This article assumes that you already know the unique id of the hard drive you want to configure. Learn hear how to get this id.
1. Edit your system's startup file
Open up a terminal window, if your are using Linux Mint copy/paste the following:
sudo pluma /etc/rc.local
on Ubuntu use
sudo gedit /etc/rc.local
The difference is just in the standard graphical text editor application installed. You can of course install pluma on Ubuntu or gedit on Linux Mint if you like.
2. Composing the right command
In a terminal window type
hdparm -B /dev/sd?
The drives that are set to a value higher than 127 (except 255) won't spin down, the drives that show "not supported" either manage this value on their own or are that old that they are not supporting power management at all. Talking about sata disks, the former is the most possible reason.
To set the drive to the highest power saving level with the highest performance and yet allow it to spin down after 15 minutes type the following command in your rc.local file. Product and Serial being the output from sudo lshw -class disk
hdparm -B127 -S180 /dev/disk/by-id/ata-PRODUCT_SERIAL
if this results in your hard drive spinning down every minute or so and not after the time you chose, instead use:
hdparm -B255 -S180 /dev/disk/by-id/ata-PRODUCT_SERIAL
safe the file, and on every startup the hard drive you want to spin down after a given idle time will do so. Instead of -S180 for 15 minutes, you can also choose one of the other values underneath.
3. Picking the idle time
since it is a very confusing logic, a list of some example values for sudo hdparm -S
60 = 5 minutes
120 = 10 minutes
180 = 15 minutes
241 = 30 minutes
242 = 1 hour
243 = 1.5 hours
244 = 2 hours