A LibreElec question

  • on my Raspberry Pi 4, I noticed that LibreElec mounted my USB SSD as "relatime". Without recompiling LibreElec, is there a way to force the USB SSD to be mounted with the "noatime" option instead of the default of "relatime"? I was surprised that the /etc/fstab file was not a link to an area in /storage.

    Raspbery Pi 4 with LibreElec 9.2.0

  • We use "udevil" to mount filesystem devices dynamically instead of storing/editing static content in /etc/fstab. You can place your own udev rules in /storage/.config/udev.rules.d that will either add-to the rules (most specific rule wins) or if you name them the same as an existing embedded rules file they will overwrite/replace the same-named rules file.

  • We use "udevil" to mount filesystem devices dynamically instead of storing/editing static content in /etc/fstab. You can place your own udev rules in /storage/.config/udev.rules.d that will either add-to the rules (most specific rule wins) or if you name them the same as an existing embedded rules file they will overwrite/replace the same-named rules file.

    Thank you. Another question: Where are the "embedded" rules located? I would like to inspect the pre-existing rules.

  • With a little bit of sleuthing, I found the rules. After spending a few hours trying different 'rules', I have come to the conclusion that using the udevil option is unproductive. I did a shell script which accomplishes the switch from relatime to noatime options and that script works.

    So, where can I read up on the startup sequence of LibreElec. Perhaps there is a point where the shell script can be executed after all the other startup processes have finished. Normally, one would use the '/etc/rc.local' file of a full featured Linux to accomplish this.

  • Two options depending on how ugly you like your script babies to be:

    a) Create /storage/.config/autostart.sh and place some commands there; the script is executed at the start of userspace boot and is blocking but you can (background)& the commands and prefix with a sleep value to have something execute 10 seconds after boot (or whenever, you control the sleep value). This is the ugly kid.

    b) Create a systemd .service file in /storage/.config/system.d to run commands or call a script; systemd gives you precise control of when the service is executed in the startup/boot workflow. This is the better way.

  • Hi brunetton,

    You can find an example here:

    morfik
    August 23, 2020 at 6:52 PM

    Regards,

  • Hi tkocou, would you share your ugly baby script ? I'm interested too !

    Thanks

    Update:

    Two issues:

    First: As far as the "relatime vs noatime" issue goes, using a vfat format on the external HDD sidesteps the issue since vfat does not support either relatime or noatime options.

    Second: The delay, between "playing" a video from an external HDD and the video actually playing, has gotten worse since implementing my fix. After observing the behavior, I've come to the conclusion that LibreElec copies the video from the HDD to the SDcard and then plays the video from the SDcard. This degradation occurs whether I play a video file located on an external HDD or when I play a streaming video from a source like Netflix or Amazon Prime.

    Fixing the degradation issue will require upgrading the hardware (Raspberry Pi 4, etc.) and fixing the RPI firmware to boot from an external HDD thereby avoiding the use of an SDcard. The only potential problem will be how to get LibreElec to honor booting up from an external USB option (now available for the Version 4). Perhaps a dual boot with RaspberryOS and LibreElec.