raspi: automatically spin external hdd down

the raspberry pi cannot spin external hard drives down. the program hdparm worked perfectly for me.

i followed this guide (htpcguides.com). just some slight little twitch i found on some other website: the device path in the /etc/hdparm.conf file should rather be the one from /dev/disk/by-uuid/… as the raspi might mount the external drive to different /dev/sdX paths. furthermore, the drive shouldnt be spun down more than need be. dont choose any spindown times lower than 15min.

$ cat /etc/hdparm.conf
/dev/disk/by-uuid/ffd9b0a1-931f-4795-85ba-28c58719a938 {
	spindown_time = 180
	write_cache = on
}

Note: The spindown_time value is multiplied by 5 and you have the total time in seconds. So a value of 120 yields 10 minutes (120*5=600).

the power managment (should the drive even be spun down) is set via the “advanced power managment” (-B) flag.

From ArchWiki: Set the Advanced Power Management feature. Possible values are between 1 and 255, low values mean more aggressive power management and higher values mean better performance. Values from 1 to 127 permit spin-down, whereas values from 128 to 254 do not. A value of 255 completely disables the feature.

for example: $ sudo hdparm -B 127 /dev/sda

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s