External HDD idle?

Hello Guys,
I have a H96 Pro+ board with 3/32GB,
I have CoreELEC 9.2 on the SD card.

I have external HDD connected via USB.

Now I’d like idle hdd fall to sleep.
I tried:

but cannot install hdparm, because coreElec is closed to apt-get install hdparm

Another try was install Kodi plugin hd-idle, which is part of system plugins. But it failed to install.

Similar problem with sleeping is here:

Thanks

Jiri

You don’t need to install “hdparm” as it’s part of the system already. (See this post)

Just make your “autostart.sh” with needed lines from mentioned link…

I use

hdparm -B 127 -S 60 /dev/sd?

in

/storage/.config/autostart.sh

Works!

CoreELEC:~ # hdparm -B 127 -S 60 /dev/sd?
/dev/sda:
 setting Advanced Power Management level to 0x7f (127)
 setting standby to 60 (5 minutes)
 APM_level      = 127

Do you need also chmod +x autostart.sh?

How to test if this works?HDD will shut down?

Thanks

No need for chmod…
Yes, HDD will shut down after 5min with above settings…

Examples:

  1. hdparm -S 60 /dev/sda1 => spindown in 5min
  2. hdparm -S 120 /dev/sda1 => spindown in 10min
1 Like

I suppose it is not supported :frowning:

CoreELEC:/dev # df
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 1288688 158564 1130124 12% /dev
/dev/mmcblk1p1 524008 173352 350656 33% /flash
/dev/mmcblk1p2 29667193 299470 29363627 1% /storage
/dev/loop0 158720 158720 0 100% /
tmpfs 1402340 0 1402340 0% /dev/shm
tmpfs 1402340 9776 1392564 1% /run
tmpfs 1402340 0 1402340 0% /sys/fs/cgroup
tmpfs 1402340 2628 1399712 0% /var
tmpfs 1402340 0 1402340 0% /tmp
/dev/sda1 1953512444 1945624648 7887796 100% /var/media/Kodi
CoreELEC:/dev # hdparm -B 127 -S 60 /dev/sda1

/dev/sda1:
setting Advanced Power Management level to 0x7f (127)
SG_IO: bad/missing sense data, sb[]: f0 00 05 00 00 00 00 10 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
setting standby to 60 (5 minutes)
SG_IO: bad/missing sense data, sb[]: f0 00 05 00 00 00 00 10 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]: f0 00 05 00 00 00 00 10 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
APM_level = not supported

I think hdparm does not support all external disks, it depends on the disk.
I use two external disks connected to USB3 ports of my N2. One is supported by hdparm, the
other gives the same error message as you have seen.

If you have problems with hd-idle from the system-plugin, you can compile it by your own.
You can download the source from https://sourceforge.net/projects/hd-idle.
It is only one binary file, I stored it as /storage/.kodi/userdata/hd-idle
and put the following lines in autostart.sh:

# hdparm not working for all USB-disks -> use hd-idle
# disk idle after 10min
/storage/.kodi/userdata/hd-idle

You have to compile hd-idle on your CE-box:

  1. install GCC with entware, if not already done
    1.a installentware
    1.b opkg install gcc
  2. download and unpack the hd-idle source from the link above
  3. cd to the hd-idle sourcedir
  4. gcc hd-idle.c -o hd-idle
  5. cp hd-idle /storage/.kodi/userdata
  6. put the lines above to your autostart.sh
  7. reboot

Hope that helps…

From where did you get hd-idle addon tools.hd-idle ?
If you got it from here, what error do you get when installing from .zip file ?

Great, I was abte to download the plugin and install it. But cannot configure. How does it work?

http://hd-idle.sourceforge.net/

Can confirm i added the autostart.sh with hdparm -S 120 /dev/sda1** => spindown in 10min

This seems to work perfectly, just what i needed. I still dont get why the unit does not automatically fall to sleep like it does on my pc?. Its really handy as the light then breaths to let you know its asleep.

This is working but light stays solid. Still i can now fall asleep knowing my drive will spin down and not be running all night.

And if u have 2 HDD?

The code would be like this:

#!/bin/sh

(

hdparm -B 127 -S 60 /dev/sda1
hdparm -B 127 -S 60 /dev/sdb2

) &

Or

(

hdparm -B 127 -S 60 /dev/sda1

) &

(

hdparm -B 127 -S 60 /dev/sdb2

) &

??

CoreELEC settings addon has option to put HDD to standby.

1 Like

I don’t know where this option is. Could you tell me where? regards

https://wiki.coreelec.org/coreelec:ce_addon_hardware#hardware

I dont understand :S Sry.

Witch the diference into Parking time and Idle time?

Don’t waste our time and read the screen:

Parking: Enable/Disable HDD parking on power off/suspend
Parking Time: Time in seconds to wait for HDD to spin down when parking
Idle Time: Time in minutes/hours until the HDD should enter suspend mode

:see_no_evil:

I think that Anjuna asked a perfectly legitimate question that is something that I have often seen as a question of clarification in regards to use in Windows and other operating systems.

My understanding (which could also be incorrect) is that when idling, the hard drive platters are spun down. This reduces energy consumption to some degree but allows enough power to continue to be supplied to the drive for it to spring back into action relatively quickly.

Parking is essentially shutting down the hard drive such that it is in more or less the same state that it is when the box is switched off. This means even more energy being saved but when reactivating the disk, it takes longer to spring back into action, which, on occasion, can give the impression that things are slower than normal, but is just the time required to bring the disk back online.

If I am incorrect then I would say that it further legitimises the initial question asked.

Note: I’m not sure if either setting has any effect on solid state drives that have no mechanical processes to idle or park but there may perhaps be scope for idle in terms of a power saving mode of operation.