Change NFS to use UDP instead of TCP

Solution 1:

in your pxelinux.cfg/default, you have probably specified something like this:

LABEL       Ubuntu
MENU LABEL  ^Ubuntu 20.04 LTS Desktop
MENU DEFAULT
KERNEL     ubuntu-live/casper/vmlinuz
APPEND     root=/dev/nfs boot=casper ip=dhcp netboot=nfs nfsroot=192.168.xx.yy:/srv/ubuntu initrd=ubuntu-live/casper/initrd

Here is the documentation for the nfsroot parameter inside the kernel command line. It says:

nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]

so the answer to your question is, just append the proto=udp option to the nfsroot parameter as specified above, like this:

APPEND     root=/dev/nfs boot=casper ip=dhcp netboot=nfs nfsroot=192.168.xx.xx:/srv/ubuntu,proto=udp initrd=ubuntu-live/casper/initrd

[edit]
This Should be the documentation of the file format used for the pxelinux.cfg/default file.

[edit2]
After a long thorough search, I think I finally found the reason, why the options in the kernel command line are ignored: Bugreport for ubuntu casper

  1. the scripts/casper script uses nfsmount, which doesn’t accept the -o udp option. Changing »nfsmount« to »mount -t nfs« is a simple change and works.

So the solution would be to fix the initrd in use for your image...