external HDD power management

I’m running DietPi on a rock64 and have Seagate Expansion Plus portable harddrive connected by usb. It seams to me that the harddive is constantly spinning. Is it possible to turn it off when inactive?

By default we add a spin down time of 10 minutes via “hdparm” package:

But I now recognize that this is just applied for the first external drive (/dev/sda) and on machines without SDcard on the root device. Make we can add an related entry automatically for each /dev/sdX device that dietpi-drive_manager finds.
Also apm=254 actually means that no spindown occurs. Not sure if this now means full I/O performance (spin speed) until 10 minutes idle, then drive completely turns off, or if those settings break each other. Will open an issue about it: https://github.com/Fourdee/DietPi/issues/2001

But note that I am not sure, of all SBCs support hdparm. Try it out by playing around with the values: https://manpages.debian.org/stretch/hdparm/hdparm.8.en.html


It is on sda and hdparm -C /dev/sda gives

drive state is: active/idle

This suggests that the drive is in normal operation. I guess it also suggest that hdparm is supported. I have the default dietpi values in hdparm.

So far so good.

Try to set apm to a lower value below 127, for limit testing to 1. This should lead to the drive spinning down most aggressively, not caring about I/O performance.

Also spindown_time could be reduced for testing. “1” means 5 seconds, “2” 10 seconds etc thus “120” 10 minutes.

I changed apm to 127 and it seems to work, thanks

Does the drive matter? I’ll be using sony ruggedized ext

I guess most drives would work. Just try it out