Wait for Network Ping for fstab mount
There are cases where it is absolute requirement to have working networking to be able to mount a remote folder. CIFS mounts are examples of that, even more so when a virtual bridge is involved since they appear to take longer to be available and working (either that or systemd services may not be properly waiting for it to be ready before continuing).
The steps below will create a new systemd service that can be set as required service to be active (here we will ping a certain local IP) before attempting to mount that folder.
-
Create the
/etc/systemd/system/wait-for-ping.service
file with the following contents. The10.0.0.1
can be replaced with any IP address, even public ones if you need to wait for the internet to be reachable. -
Reload systemctl config files
-
Enable and start (with the
--now
flag) our new service. -
Edit
/etc/fstab
and addx-systemd.after=wait-for-ping.service
in the mount options to entries of your choosing. For example, for a CIFS mount this would look like this: