Vero4k running fstab before network is up?

Hi,

I’m trying to get my fstab setup to work but it just won’t.

I’ve got 2 shares on my NAS that i’m trying to mount on boot in /mnt/video/ and /mnt/media/ .
However it never does, except for /mnt/media/ for some reason.
/mnt/video/ is never mounted after a boot.

If I do these commands:

sudo mount -a
sudo systemctl daemon-reload
sudo systemctl restart remote-fs.target

Both mounts are succesfully mounted.

This is my fstab where you can see that I have tried som additional settings to get around the problem :

#/dev/vero-nand/root / ext4 defaults,noatime 0 0
//192.168.1.108/lager/video/ /mnt/video cifs _netdev,nofail,x-systemd.device-timeout=10s,x-systemd.mount-timeout=10s,vers=3.0,x-systemd.automount,noauto,rw,iocharset=utf8,username=username,password=password,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0
//192.168.1.108/media/video/ /mnt/media cifs _netdev,nofail,x-systemd.device-timeout=10s,x-systemd.mount-timeout=10s,vers=3.0,x-systemd.automount,noauto,rw,iocharset=utf8,username=username,password=password,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0

Looking at my system log from startup the mounts seems to fail because of network is not up yet, or am I mistaken?
http://paste.osmc.io/vosemumuma.vhdl

Suddenly after network is up this happens:

Jan 14 14:49:50 osmc systemd[1]: mnt-media.automount: Got automount request for /mnt/media, triggered by 792 (LanguageInvoker)

and /mnt/media/ is successfully mounted.

I don’t know what to do, any ideas?

Do you have “wait for network” (in the wired/wireless section of MyOSMC) activated?
Also “automount” means the are not mounted on boot but just as soon as you access them.

1 Like

I’d also recommend you remove these options from the fstab line:

_netdev,nofail,x-systemd.device-timeout=10s,x-systemd.mount-timeout=10s

I don’t believe they’ll provide any benefit - but you can always add them back in if needed.

Hi,

It was not on so I activated that.
It did not make a difference exact same behaviour as before.

Yes but even without automount it does not matter.
So far no setting that I have tried is avoiding this.

I think I will since they have done nothing to aid the situation.
Just some desperate attempts on my side to get fstab to load after network had been setup.

So no change activating that box.

I’ve now removed them.

fstab looks like this

//192.168.1.108/lager/video/ /mnt/video cifs vers=3.0,x-systemd.automount,noauto,rw,iocharset=utf8,username=user,password=pass,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0
//192.168.1.108/media/video/ /mnt/media cifs vers=3.0,x-systemd.automount,noauto,rw,iocharset=utf8,username=user,password=pass,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0

Still no joy.
Log: http://paste.osmc.io/utujabolof.vhdl

How do I get fstab to run after network is up?
That is the problem looking at the log right, why it fails?

Jan 14 16:48:30 osmc systemd[1]: mnt-media.mount: Mount process exited, code=exited status=32
Jan 14 16:48:30 osmc systemd[1]: Failed to mount /mnt/media.
Jan 14 16:48:30 osmc systemd[1]: mnt-media.mount: Unit entered failed state.
Jan 14 16:48:30 osmc systemd[1]: mnt-video.automount: Got automount request for /mnt/video, triggered by 778 (JobWorker)
Jan 14 16:48:30 osmc systemd[1]: Mounting /mnt/video…
Jan 14 16:48:30 osmc systemd[1]: mnt-video.mount: Mount process exited, code=exited status=32
Jan 14 16:48:30 osmc systemd[1]: Failed to mount /mnt/video.
Jan 14 16:48:30 osmc systemd[1]: mnt-video.mount: Unit entered failed state.
Jan 14 16:48:30 osmc systemd[1]: mnt-video.automount: Got automount request for /mnt/video, triggered by 778 (JobWorker)
Jan 14 16:48:30 osmc systemd[1]: Mounting /mnt/video…
Jan 14 16:48:30 osmc systemd[1]: mnt-video.mount: Mount process exited, code=exited status=32
Jan 14 16:48:30 osmc systemd[1]: Failed to mount /mnt/video.
Jan 14 16:48:30 osmc systemd[1]: mnt-video.mount: Unit entered failed state.
Jan 14 16:48:30 osmc systemd[1]: mnt-video.automount: Got automount request for /mnt/video, triggered by 778 (JobWorker)
Jan 14 16:48:30 osmc systemd[1]: mnt-video.mount: Start request repeated too quickly.
Jan 14 16:48:30 osmc systemd[1]: Failed to mount /mnt/video.
Jan 14 16:48:30 osmc systemd[1]: mnt-video.automount: Unit entered failed state.
Jan 14 16:48:32 osmc avahi-daemon[343]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.253.
Jan 14 16:48:32 osmc avahi-daemon[343]: New relevant interface eth0.IPv4 for mDNS.
Jan 14 16:48:32 osmc avahi-daemon[343]: Registering new address record for 192.168.1.253 on eth0.IPv4.
Jan 14 16:48:32 osmc connmand[356]: eth0 {add} address 192.168.1.253/24 label eth0 family 2
Jan 14 16:48:32 osmc connmand[356]: eth0 {add} route 192.168.1.0 gw 0.0.0.0 scope 253
Jan 14 16:48:32 osmc connmand[356]: eth0 {add} route 192.168.1.1 gw 0.0.0.0 scope 253
Jan 14 16:48:32 osmc connmand[356]: eth0 {add} route 0.0.0.0 gw 192.168.1.1 scope 0
Jan 14 16:48:32 osmc connmand[356]: eth0 {add} route 159.253.212.250 gw 192.168.1.1 scope 0
Jan 14 16:48:32 osmc connmand[356]: eth0 {del} route 159.253.212.250 gw 192.168.1.1 scope 0

What should happen is that the system understands that a CIFS mount requires the network to be available. It’s a basic requirement of such a network mount.

Could you run a few commands and provide the URL from each:

systemd-analyze dump | paste-log
systemd-analyze plot | paste-log

Are you aware of any application other than Kodi that might want to access either share?

Thanks for the support!

Sure, here’s the logs.
systemd-analyze dump | paste-log:
http://paste.osmc.io/erituwovif.coffee

systemd-analyze plot | paste-log:
http://paste.osmc.io/ejugixeleh.xml

I’ve got the watchdog addon which might be trying to access the shares to scrape them att startup.
Other than that I don’t think so, only got the box on thursday so I haven’t had much time to tinker with it other than troubleshooting some issues.

Maybe I’ve done something along the way which has upset it, don’t know what though.

Could you please confirm in My OSMC > Network that “Wait for Network” has been enabled.

Please also show the output from running:

systemctl status connman-wait-for-network.service

Yes, I can confirm that.

systemctl status connman-wait-for-network.service gives:

connman-wait-for-network.service - Wait for Network to be Configured
Loaded: loaded (/lib/systemd/system/connman-wait-for-network.service; disable
Active: inactive (dead)

AFAIK setting “Wait for Network” should have enabled connman-wait-for-network.service which would have caused it to start at system boot. As you csan see it’s neither enabled, nor started.

So either you’ve encountered a problem with the My OSMC add-on not changing the status of the service or it’s not actually been set in the add-on. As I recall, the Wait For Network button should be white when selected.

Meanwhile, you can probably manually enable the service using:

sudo systemctl enable connman-wait-for-network.service

then restart and see if things have improved.

AFAIK, when mounting a SMB share you need to specify it as //SERVER/sharename where sharename is the name you assign the share in Windows. You do not use a directory path.

Update: tested this using a Win10 Home computer as server. Shares are
C:\openShare called openShare
C:\media\openShare2 called openShare2

fstab:

osmc@vero:/mnt/os3$ cat /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.15/media/openShare2/ /mnt/os2 cifs vers=3.0,x-systemd.automount,noauto,rw,iocharset=utf8,username=osmc,password=osmc,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0
//192.168.1.15/openShare/ /mnt/os1 cifs vers=3.0,x-systemd.automount,noauto,rw,iocharset=utf8,username=osmc,password=osmc,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0
//192.168.1.15/openShare2/ /mnt/os3 cifs vers=3.0,x-systemd.automount,noauto,rw,iocharset=utf8,username=osmc,password=osmc,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770 0 0

Result:

osmc@vero:/mnt$ ls -al os*
os1:
total 6396
drwxrwx--- 2 osmc osmc       0 Jan 13 09:45 .
drwxr-xr-x 6 root root    4096 Nov  3  2016 ..
-rwxrwx--- 1 osmc osmc 6542072 Jan 18  2009 blind4full.wav
ls: cannot open directory 'os2': No such device

os3:
total 6408
drwxrwx--- 2 osmc osmc       0 Jan 15 16:10 .
drwxr-xr-x 6 root root    4096 Nov  3  2016 ..
-rwxrwx--- 1 osmc osmc 6542072 Jan 18  2009 blind4full.wav
-rwxrwx--- 1 osmc osmc    8738 Oct  1  2015 linux_org.png

Thanks for the help guys.

I’ll try the:
sudo systemctl enable connman-wait-for-network.service
when I get home from work on Thursday.

grahamh:
I don’t have any issues with my fstab other than it trying to run before network is up.
If I mount manually it works perfectly.
But I’ll keep your advice in mind and I’ll try it if it still won’t work.

Noted. Just trying eliminate one possible wrinkle.

Yes, and for that I’m very grateful.
This is a very supportive forum and I appreciate all the efforts to help me.

Let’s hope for the best.

I am very happy to report that this did solve my issue!
Both shares mounts with no problem now.

Thank you so much! :grin:

It’s great to hear that it’s fixed but there’s the unresolved question of whether you had actually selected “Wait for network”. Was it a My OSMC error, or, cough, “user error”?

That was not selected at first but I did after getting the suggestion and it was indeed selected during my last log upload.
So I don’t know why it didn’t take effect…

I would be happy to admit a user error :slight_smile:

1 Like