Hello, I have been having issues where when I just boot my system nfs share takes up to a whole minute to mount, this problem doesn’t exist when I manually run command:

sudo mount -t nfs -o vers=4 192.168.0.4:/mnt/nfs /mnt/nfs

It mounts in max 2 seconds, after a fresh boot with fstab entry removed.

The fstab entry look’s like this:

192.168.0.4:/mnt/nfs    /mnt/nfs    nfs4         _netdev,noauto,x-systemd.automount,x-systemd.mount-timeout=10,timeo=14,x-systemd.idle-timeout=1min    0 0

Is there any way to fix this?

I have tried looking into the arch forums related to this issues and tried to do things like change nfs versions, adding _netdev, even backlisting module rpcsec_gss_krb5.

  • tychosmoose@lemm.ee
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 year ago

    If you want to keep using networkd, you might want to consider if multiple interfaces are causing the wait. NM doesn’t care, but networkd gives more granular options for dependencies. If you have wired and wireless and only one in use the systemd-networkd-wait-online.service waits for a timeout period. You can find lots of info on it related to boot delays with that service.

    Try the --any switch on the systemd-networkd-wait-online.service launch configuration. This will tell the wait-online service that any single routable interface is enough, you don’t need them all.

    Run:

    sudo systemctl edit systemd-networkd-wait-online.service

    That adds the override.conf for the service. Add these lines:

    
    ExecStart=
    
    ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any```
    
    The other possibility is if you have virtual .netdev devices configured (VPN, bridging, etc) and some of them are not essential for the machine to be online, you can set RequiredForOnline=no on the ones that aren't essential.