I am trying to nfs-boot a linux managed with systemd, via tftp kernel + nfs rootfs, my bootargs:

root=/dev/nfs rw nfsroot=192.168.0.10:/nfsroot/rootfs,nolock ip=192.168.0.60:192.168.0.10:192.168.0.10:255.255.255.0

Both kernel and rootfs loads successfully and the system is running, until systemd-networkd starts. After that, I can not ping the machine and NFS mount hangs (obviously).

I tried to add network config for systemd-networkd to initialize the network, but it does not work.

The serial console log:

         Starting Network Service...
...
[  OK  ] Started Network Service.
[  OK  ] Reached target Network.
...
[  *   39.330000] nfs: server 192.168.0.10 not responding, still trying

The network config:

[Match]
Name=eth0
[Network]
Address=192.168.0.60/24
Gateway=192.168.0.10
[Route]
Gateway=192.168.0.10
Destination=192.168.0.0

I wonder why systemd-networkd.service breaks the network when the system is started via nfs?

I guess when networkd starts, it withdraws the ip address, and then tries to read the config file. At this time the nfs mount already breaks, and it does not have a chance to read the config file.

If my guess is true, how to "fix" or "workaround" this issue?

  • I guess when networkd starts, it withdraws the ip address, and then tries to read the config file. At this time the nfs mount already breaks, and it does not have a chance to read the config file. – Mine Dec 22 '17 at 8:42
up vote 2 down vote accepted

It turns out that systemd-networkd provides an option to not releasing the IP.

Adding below in the config

[DHCP]
CriticalConnection=true

Then the IP will not be released and NFS will not hang.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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