nfs boot hangs after systemd-networkd starts

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












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?







share|improve this question






















  • 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
1
down vote

favorite












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?







share|improve this question






















  • 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
1
down vote

favorite









up vote
1
down vote

favorite











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?







share|improve this question














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?









share|improve this question













share|improve this question




share|improve this question








edited Dec 22 '17 at 9:53









GAD3R

22.5k154894




22.5k154894










asked Dec 22 '17 at 8:27









Mine

1415




1415











  • 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
















  • 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















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




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










1 Answer
1






active

oldest

votes

















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.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412449%2fnfs-boot-hangs-after-systemd-networkd-starts%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    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.






    share|improve this answer
























      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.






      share|improve this answer






















        up vote
        2
        down vote



        accepted







        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 26 '17 at 9:28









        Mine

        1415




        1415






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412449%2fnfs-boot-hangs-after-systemd-networkd-starts%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay