I'm trying to cleanly stop the external portable hard drives connected to my LibreElec system. The LE system is a NUC. There are 3 hdd's connected to it.
The reason I'm trying to cleanly stop the hdd's is because when I shutdown the system, it shuts off too fast. All the portable hdd's are still running during shutdown and they all come to an abrupt halt when LE shutdowns the system. When this happens I can hear the hdd heads stopping and I'm afraid this will lead to failure now or later.
I was searching this forum before I made my username and found some hepful hints to put some code in autostop.sh file.
My file is like this:
For 1 hdd it works. The connected drive power off, the sleep time i put to allow system to wait till hdd power off works.
If there are more than 1 hdd attached, i wrote code as follows:
#!/bin/sh
(
udiskctl power-off --block-device /dev/sda
udiskctl power-off --block-device /dev/sdb
udiskctl power-off --block-device /dev/sdc
sleep 5s
)&
^ This code doesn't work. The system waits for 5 seconds and all drives shut off at once. I've attached the Kodi log.