Tagged: CIFS Mount NAS
27. December 2016 at 18:13 #25263
my RasPi is powered by the USB port of my NAS – works fine.
However the RasPi boots much faster than the nas resulting in an empty mount directory.
The only way to resolve this for now is rebooting my RasPi again once the NAS is up and running.
I think i would need some mount script that periodocally checks if the NAS is up before mounting, but maybe one of you has got a better/easier solution…
Thanks for any hints5. January 2017 at 15:46 #25567
Sorry about the late response. If you are using the device for the LMS, you might want to check out our feature for delayed start on boot (it’s in the Squeezebox Server menu). This results in the server starting delayed and thus scanning and indexing the files later when your NAS is ready.16. January 2017 at 13:09 #25928
thanks for your reply. But this didn’t work.
The problem is not the scanning of the files.
When my Raspi is booting, it mounts the network share which stores all of the music.
But the NAS is still booting when the RasPi is trying to mount. Since the mount fails, the corresponding directory is empty.
If I reboot the RasPi or if i mount manuall once the NAS is running everything is fine.
So I’m looking for a script that delays the mount until the NAS is ready.
But it is not that urgent.18. January 2017 at 15:12 #26027
Okay,Gotcha. Here are a few solutions detailed you could try to solve your issue: http://raspberrypi.stackexchange.com/questions/33037/how-to-add-delay-at-boot28. February 2017 at 23:40 #27357
Alright, I got it working. Instead of delaying at boot, i added a script that does the following:
If the directory is mounted –> do nothing
If the directory is not mounted:
– check if the NAS is reachable (using ping)
– if yes, mount
here’s my code (don’t forget to add noauto to your mountpoint in fstab)
#!/bin/bash if mount | grep /mnt/Music > /dev/null; then echo "/mnt/Music already mounted - nothing to do" else echo "/mnt/Music not mounted, pinging discworld" if ping -c 2 "myServer" >/dev/null; then mount /mnt/Music echo "/mnt/Music successfully mounted" fi fi
in the end, i’m calling this script every minute in crontab:
* * * * * root /usr/local/bin/mount_nas.sh
Thanks for your help heiner!
You must be logged in to reply to this topic.