I'm trying to mount my shares at boot but i can't seem to figure out why it's not working, either in Ubuntu or Docker.

pastebin of my versions: https://pastebin.com/jBkEyjLQ

I have a few shares in my /etc/fstab i.e.

//nasserver/Movies /mnt/movies/ cifs iocharset=utf8,credentials=/home/user/.smbcred,gid=1001,file_mode=0770,dir_mode=0770,sec=ntlmssp 0 0

When i use sudo mount -a they mount on the localhost and i can access the shares within the Docker containers (i.e. Plex can access the data).

But when i reboot, the shares are not mounted. From what i can find on the internet it has something to do with the network not being up yet, so the shares are 'mounted' but because there is not network yet, they fail or something.

I tried the following:

  • added _netdev to /etc/fstab but the shares won't mount
  • same for adding x-systemd.after=network-online.target to /etc/fstab
  • tried adding x-systemd.automount and comment=systemd.automount to the fstab. (from my understanding, they are the same, whereas the 'comment-version' is old and undocumented). Eitherway, the shares are mounted on the localhost, but i can't access them in the containers. Something about a symlink loop.
  • i tried using a timeout x-systemd.device-timeout=30 but the shares wouldn't mount.
  • i even tried making a cronjob to execute the mount -a but without much luck. i added @reboot root /bin/bash -c 'sleep 10 && /bin/mount -a' to /etc/crontab. the shares are mounted and accessible locally, but not in the containers.

To clarify, when i say they aren't accessible in the containers, i can browse to the shared folder, but nothing is there. As if the share never mounted in the containers.

Also, when i see the login-interface on my machine and try to SSH into it, i get the message that i couldn't connect. However, when i reboot and immediately log into the server (locally) and check ifconfig i see the network interface and a IP-address. I can even ping google.com and get replies.

Is there anything i can check to see where the problem lies? or maybe something like slowing down the mounting of the shares?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.