Posts by dokidoki

    Thank you mglae and chewitt. I tried both the scripts. The first script didn't work and i saw errors in the journal. Then i saw the second script here and overwrote the first script. I'm getting the same errors like in first script.

    Code
    /bin/sh: can't open '/storage/.config/shutdown.sh': No such file or directory
    ......
    /storage/.config/autostop.sh: line 7: udiskctl: not found

    I'm uploading the entire log here i took using journalctl -b -1

    I think Kodi unmounts the devices using ntfs-3g or another service even before the shutdoown script is run. So when the script does run it is throwing errors.

    journal2.txt

    One thing I noticed is that the disks don't make that dreaded noise after putting the shutdown script. They don't power off but the hard disk heads are already parked before they shut down so no noise now.

    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:

    Code
       #!/bin/sh
            (
                udiskctl power-off --block-device /dev/sda
                sleep 5s
            )&

    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:

    Bash
    #!/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.

    kodi.log