systemd fails to mount CIFS share at boot with _netdev option: "mount error(101): Network is unreachable"
0
votes
0
answers
66
views
I'm trying to automatically mount a CIFS network share at
/mnt/Share
using systemd on boot, with the _netdev option in /etc/fstab
. However, the mount fails with the following error in journalctl
:
May 11 13:11:52 laptop-jonte systemd: Mounting
/mnt/Share...
May 11 13:11:52 laptop-jonte mount: mount error(101): Network is unreachable
May 11 13:11:52 laptop-jonte mount: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
May 11 13:11:52 laptop-jonte systemd: mnt-Share.mount: Mount process exited, code=exited, status=32/n/a
May 11 13:11:52 laptop-jonte systemd: mnt-Share.mount: Failed with result 'exit-code'.
May 11 13:11:52 laptop-jonte systemd: Failed to mount /mnt/Share.
It seems like the network isn't up yet when the mount is attempted. The share mounts fine manually after boot.
My /etc/fstab
looks like the following:
//192.168.178.33/share /mnt/Share cifs credentials=/etc/smbcredentials/.smbcredentials,uid=1000,gid=1000,iocharset=utf8,auto,_netdev,vers=3.0 0 0
Note that x-systemd.automount
is not an option for me, as it causes the share to mount at boot, but with root ownership instead of the intended user.
So the question is simple: **How can I mount a smb share at boot with user permissions consistently?**
Asked by NLion74
(1 rep)
May 11, 2025, 11:23 AM