Silencing my attached Drives (HDD's)

I have two machines running. One is a file/download server. A regular but low powered x64 PC with two large HDD’s and one SDD. Most of this time system is idle (consuming little or no power), except when viewing content. The other is a NUC running Home assistant OS which, obviously, is on 24/7.

I’d like to combine the two, thus freeing up one machine, running needed programs in one docker environment and mainly to reduce overall power consumption.

I’ve been experimenting with quite a few Home Assistant installs (supervised on various distro’s), but I kept coming back to the standard HA install. It uses the least resources.

This type of install has one catch though; mounting internal (or external) HDD’s on Home Assistant OS. I’ve been sifting through various topics about mounting internal or external drives seen by the host system but not by HA or other docker containers. Some solutions worked, some didn’t, some only worked for a specific container but none of them worked system wide.

But then I found the simplest solution. Mounting drives using a udev rule. Host drives available for Home assistant itself (/media) AND available for other containers/addons. No need for HA configuration editing, automation scripts, samba or docker volume binding.

But I can’t get the drives to shut up! I’d like the attached media drives to go idle after a specific period. After a terminal login on the attached monitor (not through SSH), I used the hdparm command to alter the idle state of the attached drives immediately using:

hdparm -Y /dev/sda and hdparm -Y /dev/sdb.
The drives stopped spinning at once. So both supported power management

But I needed a grace period for the drive to stop spinning after being used. Giving them a value of 180 should stop them from spinning after a grace period of 15 minutes:

hdparm -S 180 /dev/sda and hdparm -S 180 /dev/sdb

But after the expired time and without any user activity, both drives kept spinning. I now wonder if something or some process within HA is preventing the drives from going idle?

I realize the standard Home assistant OS is not designed to natively mount attached drives and the above mentioned solution is somewhat of a hack, but I’d really like my drives to stop spinning (and using power 24/7)

1 Like