I am running a Debian12 with systemd. The server's network is configured through (fixed lease) dhcp.
I am trying to mount a CIFS remote filesystem on boot. So I added the follwoing entries in /etc/fstab:
//qnap/scan_in /srv/incoming cifs domain=mydom,credentials=/root/secret.txt,_netdev,uid=paperless,gid=paperless 0 0
This is not mounted during boot (on the console it displays some error). But when I do a mount -a after boot it runs fine.
I checked journalctl -b0 (for boot messages) and saw these entries:
Apr 27 11:27:38 paperless systemd[1]: Mounting srv-incoming.mount - /srv/incoming...
Apr 27 11:27:38 paperless dhclient[603]: DHCPREQUEST for 192.168.9.3 on ens3 to 255.255.255.255 port 67
[...]
Apr 27 11:27:38 paperless mount[626]: mount error: could not resolve address for qnap: Unknown error
Apr 27 11:27:38 paperless systemd[1]: srv-incoming.mount: Mount process exited, code=exited, status=1/FAILURE
Apr 27 11:27:38 paperless dhclient[603]: DHCPACK of 192.168.9.3 from 192.168.9.254
Apr 27 11:27:38 paperless sh[603]: DHCPACK of 192.168.9.3 from 192.168.9.254
Apr 27 11:27:38 paperless systemd[1]: srv-incoming.mount: Failed with result 'exit-code'.
Apr 27 11:27:38 paperless systemd[1]: Failed to mount srv-incoming.mount - /srv/incoming.
Apr 27 11:27:38 paperless cron[629]: (CRON) INFO (Running @reboot jobs)
Apr 27 11:27:38 paperless systemd[1]: Dependency failed for remote-fs.target - Remote File Systems.
Apr 27 11:27:38 paperless systemd[1]: remote-fs.target: Job remote-fs.target/start failed with result 'dependency'.
So it looks like the _netdev parameter is not properly taken into account because it tries to mount before the DHCPACK got send.
Of course it can not connect to the server as long as the network is not up and running.
But why does it obviously ignore the "_netdev" and starts mounting before even sending the DHCPREQUEST?
Thanks for all ideas& input!
/CV