external HDD power management

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
asplundj
Posts: 12
Joined: Wed Nov 01, 2017 9:03 am

external HDD power management

Post by asplundj »

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?
User avatar
MichaIng
Site Admin
Posts: 2262
Joined: Sat Nov 18, 2017 6:21 pm

Re: external HDD power management

Post by MichaIng »

@asplundj
By default we add a spin down time of 10 minutes via "hdparm" package:
https://github.com/Fourdee/DietPi/blob/ ... 1231-L1241

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/hdp ... .8.en.html
asplundj
Posts: 12
Joined: Wed Nov 01, 2017 9:03 am

Re: external HDD power management

Post by asplundj »

Thanks

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

/dev/sda:
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.
User avatar
MichaIng
Site Admin
Posts: 2262
Joined: Sat Nov 18, 2017 6:21 pm

Re: external HDD power management

Post by MichaIng »

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.
asplundj
Posts: 12
Joined: Wed Nov 01, 2017 9:03 am

Re: external HDD power management

Post by asplundj »

I changed apm to 127 and it seems to work, thanks
xianw79
Posts: 3
Joined: Wed Aug 15, 2018 3:02 pm

Re: external HDD power management

Post by xianw79 »

asplundj wrote: Sat Aug 11, 2018 4:18 pm I changed apm to 127 and it seems to work, thanks
Does the drive matter? I'll be using sony ruggedized ext
asplundj
Posts: 12
Joined: Wed Nov 01, 2017 9:03 am

Re: external HDD power management

Post by asplundj »

xianw79 wrote: Wed Aug 15, 2018 3:17 pm
asplundj wrote: Sat Aug 11, 2018 4:18 pm 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
Post Reply