Hi all
I have LibreELEC installed on a Raspberry Pi 4 - and it is great. I am using it with TVHeadend and want to store my recordings on a NAS. I can mount the NAS through SSH without any problem, but need the system to do this automatically at boot.
I found this in the Wiki, which looks like the right way of doing it (https://wiki.libreelec.tv/configuration/…20using%20nano.) but the instructions say "but note they will block the boot process until they complete, and the network stack will not be up when the script runs" which worried me.
Clearly if I try to mount the drive before the network stack is up, then it will fail. If I put in a wait for ping loop, then that will never occur until after the autostart.sh is complete (so the system will never boot - I assume).
So... how do I automatically mount the NAS on boot with these constraints?
Thanks
RPi 4 - Automount NAS on boot
-
robbo100 -
February 7, 2022 at 6:25 PM -
Thread is Unresolved
-
- Go to Best Answer
-
Go look at the systemd .mount file samples in /storage/.config/system.d .. these are sequenced correctly during startup to mount things after the network comes up and before Kodi (and TVH add-ons) are started.
-
1. Create a mountpoint like /storage/Recordings, go to /storage/.config/system.d and create a new file like recordings.mount
Code
Display More[Unit] Description=cifs mount script Requires=network-online.service After=network-online.service Before=kodi.service [Mount] What=//192.168.178.10/Recordings Where=/storage/Movies Options=username=yourusername,password=yourpassword Type=cifs [Install] WantedBy=multi-user.target
save it.
2. run systemctl daemon-reload
3. run systemctl enable recordings.mount
4. reboot
you should be able to access your content
-
Brilliant. Thanks both of you, I will give that a go.
-
- Best Answer
we have a wiki article that covers it