2

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

1
  • 1
    Addition: If I configure my interface to static IP it works absolutely fine! Commented Apr 27, 2024 at 9:45

2 Answers 2

1

I finally resolved the issue even though I do not know WHY this is working as a solution.... well, more related to a workaround. However, it's working with replacing the hostname by its IP address:

//192.168.0.14/scan_in /srv/incoming cifs domain=mydom,credentials=/root/secret.txt,_netdev,x-systemd.after=network-online.target,uid=paperless,gid=paperless 0 0 

If using the hostnmae (short or long) I havev the issue mentioned above.

0

Adding the following option to fstab should wait for network be online before mounting:

x-systemd.after=network-online.target

Therefore the fstab line should be:

//qnap/scan_in /srv/incoming cifs domain=mydom,credentials=/root/secret.txt,_netdev,uid=paperless,gid=paperless,x-systemd.after=network-online.target 0 0

Debian reference:
https://manpages.debian.org/testing/systemd/systemd.mount.5.en.html#FSTAB

1
  • Still the same. Added _netdev,x-systemd.after=network-online.target but noch change. Commented Apr 28, 2024 at 5:16

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.