So while I'm waiting for some help, I thought I'd dig a bit more into the HDD led activity always on and found why the HDDs always spin up even though all services and shares are closed.
I had 3 terminal sessions open;
- 1 with the "top" command running
- 1 running with command: watch -n 10 "hdparm -C /dev/sda /dev/sdb" # Done after I had explicitely put the drives to sleep with hdparm -Y /dev/sda /dev/sdb
- 1 running with command: watch -n 10 ""ls -latr <folder>"
Initially, folder was /var/log as I was suspecting something to be written there but no dice. Where the drives are in "standby" mode, nothing gets written there (I had cleared out the folder initially)
Then I decided to check the /tmp folder and I had noticed that once the drives spin up, logrotate.status would get updated. So thinking it was a "write memory cache" to disk think, I had initially symlinked /tmp/logrotate.status to /dev/null. No luck there
Then I found it. When the drives would spin up (roughly once an hour at the half-past the hour mark), I would notice a "smartctl" command being executed in "top" so I did a grep loop to capture the command being run:
root 13361 17625 16 08:38 pts/2 00:00:00 /usr/sbin/smartctl -d sat -T verypermissive -s on -H /dev/sda
So trying out each of the flags individually, I found that it is the "-s on" flag that makes the drives spin up **every time**. I put the drives manually in sleep mode, execute the command above and drives spin up again. Remove the "-s on" and the drives don't spin up and stay in standby mode.
In my opinion, that flag should only be executed either on boot up, after a raid reconstruction, or at the very least if the drives are flagged as "active/idle" mode, not in standby mode.
Btw, even when drives are in sleep mode, the HDD light is always on. From what I've gathered from the tests so far, is that the "on" signal/flag is inverted, meaning that it should be on when it's off, and off when it's on.
I wish I had enough knowledge to at least fix the 2 issues mentioned in this post but I don't. I'm open to any suggestions.
PS: Still have no idea why the system always turns itself on though. I don't think it's a hardware problem because the unit does shut itself down completely when the initial flash from a USB stick is done.
Edit: typo fixes