Mounting smb shares on boot produces empty directory

I have mounted two samba shares using FSTAB (/etc/fstab), one to /media/Movies and /media/TV Shows. They were working fine initially, but upon reboot, those directories appear empty and screws up my Kodi library.

I can fix this by entering sudo mount -a from the SSH command line, which causes the directories to be populated properly.

Why won’t fstab do this properly on boot? Is there a way I can automate the sudo mount -a command?

I would guess the drive(s) are not spinning up fast enough. Please post your fstab so we can see the options you are using.

Or consider using autofs.

I figured it out. Turns out that the drives were trying to mount on boot before the network connection was set up. I went to My OSMC -> Network and ticked the “Wait for network” option and now it seems to work fine.