2

On a newish 18.04 system, I added a few SMB mounts to my fstab and verified they do mount, interactively.

When my system boots, it complains about CIFS mount errors, then tells me I am in emergency mode and proceeds to cloud-init (eventually obtaining an IP address, I think). If I bypass the emergency mount, I find my mounts to have been mounted no problem, probably after it obtained an IP)

Would love some advice as I'd like for this machine to boot unattended.

I have attached a screenshot and various excerpt of my journalctl -b log that seem relevant.

Sep 15 20:46:47 watcher kernel: FS-Cache: Netfs 'cifs' registered for caching
Sep 15 20:46:47 watcher kernel: Key type cifs.spnego registered
Sep 15 20:46:47 watcher kernel: Key type cifs.idmap registered
Sep 15 20:46:47 watcher kernel: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
Sep 15 20:46:47 watcher mount[645]: mount error(101): Network is unreachable
Sep 15 20:46:47 watcher mount[645]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Sep 15 20:46:47 watcher kernel: CIFS VFS: Error connecting to socket. Aborting operation.
Sep 15 20:46:47 watcher kernel: CIFS VFS: cifs_mount failed w/return code = -101
Sep 15 20:46:47 watcher systemd[1]: mnt-downloads.mount: Mount process exited, code=exited status=32
Sep 15 20:46:47 watcher systemd[1]: mnt-downloads.mount: Failed with result 'exit-code'.
Sep 15 20:46:47 watcher systemd[1]: Failed to mount /mnt/downloads.
Sep 15 20:46:47 watcher systemd[1]: Dependency failed for Local File Systems.
...
    Sep 15 20:46:53 watcher cloud-init[491]: Cloud-init v. 18.3-9-g2e62cb8a-0ubuntu1~18.04.2 running 'init-local' at Sat, 15 Sep 2018 20:46:53 +0000. Up 21.61 seconds.
Sep 15 20:46:53 watcher systemd[1]: Started Initial cloud-init job (pre-networking).
Sep 15 20:46:53 watcher systemd[1]: Reached target Network (Pre).
Sep 15 20:46:53 watcher systemd[1]: Starting Raise network interfaces...
Sep 15 20:46:53 watcher systemd[1]: Starting Network Service...
Sep 15 20:46:53 watcher systemd-networkd[910]: Enumeration completed
Sep 15 20:46:53 watcher systemd[1]: Started Network Service.
Sep 15 20:46:53 watcher systemd-networkd[910]: lo: Link is not managed by us
Sep 15 20:46:53 watcher systemd-networkd[910]: eno1: IPv6 successfully enabled
Sep 15 20:46:53 watcher systemd[1]: Starting Network Name Resolution...
Sep 15 20:46:53 watcher systemd[1]: Starting Wait for Network to be Configured...
Sep 15 20:46:53 watcher kernel: IPv6: ADDRCONF(NETDEV_UP): eno1: link is not ready
...
Sep 15 20:46:53 watcher systemd[1]: Started Network Name Resolution.
Sep 15 20:46:53 watcher systemd[1]: Reached target Host and Network Name Lookups.
Sep 15 20:46:53 watcher systemd[1]: Started Raise network interfaces.
Sep 15 20:46:53 watcher systemd[1]: Reached target Network.
Sep 15 20:46:57 watcher systemd-networkd[910]: eno1: Gained carrier
Sep 15 20:46:57 watcher kernel: e1000e: eno1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
Sep 15 20:46:57 watcher kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eno1: link becomes ready
Sep 15 20:46:57 watcher systemd-networkd[910]: eno1: DHCPv4 address 192.168.7.229/24 via 192.168.7.1
Sep 15 20:46:57 watcher systemd-timesyncd[743]: Network configuration changed, trying to establish connection.
Sep 15 20:46:58 watcher systemd-networkd[910]: eno1: Gained IPv6LL
Sep 15 20:46:58 watcher systemd-networkd[910]: eno1: Configured
Sep 15 20:46:58 watcher systemd-timesyncd[743]: Network configuration changed, trying to establish connection.
Sep 15 20:46:58 watcher systemd-networkd-wait-online[942]: managing: eno1
Sep 15 20:46:58 watcher systemd-networkd-wait-online[942]: ignoring: lo
Sep 15 20:46:58 watcher systemd[1]: Started Wait for Network to be Configured.
Sep 15 20:46:58 watcher systemd[1]: Starting Initial cloud-init job (metadata service crawler)...
Sep 15 20:46:58 watcher cloud-init[1030]: Cloud-init v. 18.3-9-g2e62cb8a-0ubuntu1~18.04.2 running 'init' at Sat, 15 Sep 2018 20:46:58 +0000. Up 26.99 seconds.
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: +++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: +--------+------+------------------------------+---------------+--------+-------------------+
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: | Device |  Up  |           Address            |      Mask     | Scope  |     Hw-Address    |
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: +--------+------+------------------------------+---------------+--------+-------------------+
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: |  eno1  | True |        192.168.7.229         | 255.255.255.0 | global | xx:xx:xx:xx:xx:c7 |
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: |  eno1  | True | fe80::5265:f3ff:fe1c:6dc7/64 |       .       |  link  | xx:xx:xx:xx:xx:c7 |
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: |   lo   | True |          127.0.0.1           |   255.0.0.0   |  host  |         .         |
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: |   lo   | True |           ::1/128            |       .       |  host  |         .         |
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: +--------+------+------------------------------+---------------+--------+-------------------+
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: ++++++++++++++++++++++++++++++Route IPv4 info++++++++++++++++++++++++++++++
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: +-------+-------------+-------------+-----------------+-----------+-------+
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: | Route | Destination |   Gateway   |     Genmask     | Interface | Flags |
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: +-------+-------------+-------------+-----------------+-----------+-------+
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: |   0   |   0.0.0.0   | 192.168.7.1 |     0.0.0.0     |    eno1   |   UG  |
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: |   1   | 192.168.7.0 |   0.0.0.0   |  255.255.255.0  |    eno1   |   U   |
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: |   2   | 192.168.7.1 |   0.0.0.0   | 255.255.255.255 |    eno1   |   UH  |
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: +-------+-------------+-------------+-----------------+-----------+-------+
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: +-------+-------------+---------+-----------+-------+
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: | Route | Destination | Gateway | Interface | Flags |
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: +-------+-------------+---------+-----------+-------+
Sep 15 20:46:58 watcher cloud-init[1030]: ci-info: |   1   |  fe80::/64  |    ::   |    eno1   |   U   |
Sep 15 20:46:59 watcher cloud-init[1030]: ci-info: |   3   |    local    |    ::   |    eno1   |   U   |
Sep 15 20:46:59 watcher cloud-init[1030]: ci-info: |   4   |   ff00::/8  |    ::   |    eno1   |   U   |
Sep 15 20:46:59 watcher cloud-init[1030]: ci-info: +-------+-------------+---------+-----------+-------+
Sep 15 20:46:59 watcher systemd[1]: Started Initial cloud-init job (metadata service crawler).
Sep 15 20:46:59 watcher systemd[1]: Reached target Cloud-config availability.
Sep 15 20:46:59 watcher systemd[1]: Reached target Network is Online.
Sep 15 20:46:59 watcher systemd[1]: Starting iSCSI initiator daemon (iscsid)...
Sep 15 20:46:59 watcher iscsid[1080]: iSCSI logger with pid=1083 started!
Sep 15 20:46:59 watcher systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 15 20:46:59 watcher systemd[1]: Starting Availability of block devices...
Sep 15 20:46:59 watcher systemd[1]: Reached target Remote File Systems (Pre).
Sep 15 20:46:59 watcher systemd[1]: Mounting /mnt/video...
Sep 15 20:46:59 watcher kernel: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
Sep 15 20:46:59 watcher systemd[1]: mnt-docker.mount: Directory /mnt/docker to mount over is not empty, mounting anyway.
Sep 15 20:46:59 watcher systemd[1]: Mounting /mnt/docker...
Sep 15 20:46:59 watcher systemd[1]: Mounting /mnt/Titan...
Sep 15 20:46:59 watcher systemd[1]: Started Availability of block devices.
Sep 15 20:46:59 watcher kernel: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
Sep 15 20:46:59 watcher kernel: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
Sep 15 20:46:59 watcher systemd[1]: Mounted /mnt/video.
Sep 15 20:46:59 watcher systemd[1]: Mounted /mnt/docker.
Sep 15 20:46:59 watcher systemd[1]: Mounted /mnt/Titan.
Sep 15 20:46:59 watcher systemd[1]: Reached target Remote File Systems.

3

In /etc/fstab, on those entries, try adding the option _netdev or, if that doesn't work, add

x-systemd.after=network-online.target
  • That worked, thanks very much. Hadn’t found a solution anywhere that pointed to that – ferik Sep 19 '18 at 23:30
0

Having had a similar problem and since the _netdev option did not help in my case, I wanted to share another very simple solution, which I found only after much fruitless tinkering with the _netdev param, the @reboot param of Crontab the sleep command, and the file rc.local):

There should be a folder with the name

/etc/network/if-up.d

Any script you dump there will be executed only after the network link is up.

How it works: Just add a fstab entry with the common options (I had to use 'vers=3.0' as well but this is another story). Then write a simple executable script with the line mount -a and dump it in the aforementioned dir.

Very simple and works like a charm in my case but it does not seem to be common knowledge.

  • 2
    Do not repost the same answer multiple times to multiple questions. If the questions are similar enough, flag the questions as duplicates of this one. Otherwise, please refrain from posting the same solution multiple times - duplication of content doesn't help things, necessarily. – Thomas Ward Oct 9 '18 at 14:14
  • Well if it does help (and it very well could), it is just a question of form...Will try to comply with form next time though.. – user878031 Oct 9 '18 at 16:51

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.