Trying to connect to network drive via fstab to roms folder but it fails on boot
-
Hello everyone! I'm a noobie, and I was wondering if someone with some expirience could assist me with a very perticular problem.
Setup: Raspberry plugged in via Ethernet. Rom storage on a Windows 10 machine (roms folder is shared)
I made sure to maitain the exact folder structure as the RetroPie's /roms folder on the Windows roms share.I just installed RetroPie, and I thought edit fstab so that the /roms folder would be mount then scanned for games.
I've configured my fstab to look like this:
//10.0.0.110/roms /home/pi/RetroPie/roms cifs username=deepnote,password=Pa11word,iocharset=utf8 0 0
I have done this before on other ocassions for other purposes. However I seem to be having an issue where the mount failed to mount on boot everytime.
The first thing I checked once I log in via SSH and try to check the status of the mount
https://i.imgur.com/RwBOc4j.pngHowever once I'm in the machine, I run a
sudo mount -a
and the share will mount successfully without any problems and you can traverse the directory to the roms without an issue.
https://i.imgur.com/3ojqOwJ.pngI then check the systemctl status again
https://i.imgur.com/Wvy2z6W.pngAs you can see the mount is up and running
I check its IP and it has a local IP 10.x.x.x and it indeed has an IP
I then started paying attention to the boot sequence as the Pi started up and I noticed the following:
https://i.imgur.com/vGjngEh.jpgfor some reason at somepoint during boot the IP given is a 169.254.x.x APIPA address which makes sense that the mount would fail.
I checked the wire to make sure that wasn't the problem by replacing it. However the problem continues.
I feel that during boot it is given the APIPA address and then later it obtains the proper address, but by then Emulationstation has started fully and scans for the roms cant begin.
Would someone be able to help me with this issue. I thank you in advace for any help you guys and girls can provide
-
@DeepNote it's probably because the mount is happening before DHCP has finished. Ignore the IP shown on boot - that's also before DHCP.
I'm not sure if the raspi-config wait for network option will wait for DHCP but you can check what it's set to.
Also you can mount it later via autostart.sh adding a sleep command before or a little script that pings a LAN IP and continues when it succeeds or something. Don't have time for a more detailed answer right now sorry.
-
@BuZz I had a similar problem with a Raspberry Pi running a plex server. Indeed turning on the “wait for network at boot” option did solve the problem.
-
Thank you for the heads up on the
sleep
command I've placed it for 10 seconds and it worked like a charm.Thank so much!
-
After I wrote this article I found that option in the Boot Options menu, I set it to wait for network connectivity however for some reason that did not work. however setting a sleep command to the autostart.sh worked well. Using the autostart.sh sleep and mount command worked properly.
Thank you for your valued input:)
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.