Unable to auto mount smb share on boot

Hi,
I am unable to mount smb share on boot.
Here is link to log files: https://paste.osmc.tv/ayadetoboj
My /etc/fstab

# rootfs is not mounted in fstab as we do it via initramfs. Uncomment for remount (slower boot) /dev/vero-nand/root 
#/ ext4 defaults,noatime 0 0
//192.168.1.70/Filmy /mnt/Filmy cifs x-systemd.automount,noauto,rw,iocharset=utf8,username=hidden,password=hidden,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0
//192.168.1.70/Seriale /mnt/Seriale cifs x-systemd.automount,noauto,rw,iocharset=utf8,username=hidden,password=hidden,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0

Is it due to network interface turning online too late?

Dec 10 21:56:53 osmc systemd[1]: Failed to mount /mnt/Seriale.
Dec 10 21:56:53 osmc systemd[1]: Unit mnt-Seriale.mount entered failed state.
Dec 10 21:56:55 osmc sudo[780]: osmc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/rm /var/tmp/osmc.settings.update.sockfile
Dec 10 21:56:55 osmc sudo[780]: pam_unix(sudo:session): session opened for user root by (uid=0)
Dec 10 21:56:55 osmc sudo[780]: pam_unix(sudo:session): session closed for user root
Dec 10 21:56:55 osmc sudo[797]: osmc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/rm /var/tmp/osmc.settings.sockfile
Dec 10 21:56:55 osmc sudo[797]: pam_unix(sudo:session): session opened for user root by (uid=0)
Dec 10 21:56:55 osmc sudo[797]: pam_unix(sudo:session): session closed for user root
Dec 10 21:56:55 osmc avahi-daemon[295]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.17.
Dec 10 21:56:55 osmc avahi-daemon[295]: New relevant interface eth0.IPv4 for mDNS.
Dec 10 21:56:55 osmc avahi-daemon[295]: Registering new address record for 192.168.1.17 on eth0.IPv4.
Dec 10 21:56:55 osmc connmand[317]: eth0 {add} address 192.168.1.17/24 label eth0 family 2
Dec 10 21:56:55 osmc connmand[317]: eth0 {add} route 192.168.1.0 gw 0.0.0.0 scope 253 <LINK>
Dec 10 21:56:55 osmc connmand[317]: eth0 {add} route 192.168.1.1 gw 0.0.0.0 scope 253 <LINK>
Dec 10 21:56:55 osmc connmand[317]: eth0 {add} route 0.0.0.0 gw 192.168.1.1 scope 0 <UNIVERSE>
Dec 10 21:56:55 osmc connmand[317]: eth0 {add} route 159.253.212.250 gw 192.168.1.1 scope 0 <UNIVERSE>
Dec 10 21:56:55 osmc connmand[317]: eth0 {del} route 159.253.212.250 gw 192.168.1.1 scope 0 <UNIVERSE>

I have also tried to add “_netdev” (normally the file system type is used to determine if a mount is a “network mount”, i.e. if it should only be started after the network is available. Using this option overrides this detection and specifies that the mount requires network) to fstab option, but it made no difference.

Once your system is booted, can you manually mount them?

$ sudo mount /mnt/Filmy

Yes.

Hi,

Have you got wait for network enabled in myosmc?

Thanks Tom.

Yes, it’s enabled, wired connection.
Via logs I assume that network connection is not available fast enough to mount network shares. So what is the way do delay mounting network drive at boot?

Looking in your log, you appear to have something in Kodi that is trying to scan your library on startup. Try turning that off.

21:56:52.911 T:4087346160  NOTICE: VideoInfoScanner: Starting scan ..
21:56:53.126 T:4087346160 WARNING: Process directory '/mnt/Filmy/' does not exist - skipping scan.

Yes, it’s “update library on startup” in Media Options.
I have disabled it, no difference.

Hi,

This is not normally required, but you could try adding x-systemd.requires=network-online.target to the fstab entry

Thanks Tom.

I have added x-systemd.requires=network-online.target, still doesn’t mount on boot.

It looks like this after reboot:

When I manually hit “Update library” in OSMC/Kodi, network drives mount:

But “Update library on startup” doesn’t work as mentioned in previous post.

So with Update Library off, it does seem to be working? (Because of the automount, the drives will not mount until accessed). If thats the case, it may be that Kodi is ignoring the Wait For Network option.

For fun, try turning the option off, reboot and then turn it back on and reboot. Maybe the option just didn’t get set correctly.

It doesn’t mount smb shares during boot regardless whether the “Update Library on startup” is set to on or off.

Hu? Your screenshot clearly shows they are being mounted.

It doesn’t mount smb shares during boot regardless whether the “Update Library on startup” is set to on or off.

But mounts when I manual update library.

That is the correct behavior. They will not mount until accessed. So the question is why the Update On Startup option is not waiting for the network.

Because systemd is not mounting smb shares properly during boot?

Ok, I think you don’t understand automount. It is clearly working properly. The problem is that Kodi is not waiting for the network to be up before doing the Update Library On Startup. We need to figure out why it’s not waiting as it should.

Did you try my suggestion to turn of ‘Wait For Network’ and turn it back on?

1 Like

I have toggled it off and on again, and now it works! Thanks.

Cool! So for some reason MyOSMC thought is was set but it wasn’t. Glad to know it’s fixed.

1 Like