Full Network Boot and Network Filesystem for Rpi4s

For now I’m putting this in general but might write a tutorial for network booting RPi4s and keeping their full filesystem on a NFS share.

Overall the instructions are the same as the others found on the Internet for network booting a RPi4. The only gotcha was that DietPi didn’t seem happy to get the network stack going (hung during bootup with messages I don’t have handy). I disabled the interface in DietPi and that seemed to make everything work - the system actually boots with the interface working. I assume this is something to do with “Oh, it’s already here!”.

Rough instructions for now:

  1. Update the bootroms on your Rpi and set the configuration to boot of the network. This requires a bootable existing RPi OS with a couple utilities. While you are there get the MAC address of each system and write it down. DietPi was fine for this.

  2. Setup a TFTP server, make a directory in the root for each MAC address with the format dc-a6-32-01-36-c2 and put the contents of /boot from a working OS image into it.

  3. Setup a NFS server and put a copy of both boot and root into a directory named something unique. It might be good to use the MAC addresses?

  4. Setup your DHCP server to include necessary PXE boot options and point them at the server from step 2. Instructions are elsewhere on the Internet - this can be tricky - having a display on the RPi when it boots can help diagnose problems.

  5. Modify the cmdline.txt on the server you’re booting from to reflect that root is on NFS, meaning the server from step 3. Something like:

nfsrootdebug usb-storage.quirks=152d:0578:u root=/dev/nfs nfsroot=,tcp,rw,v3 ip=dhcp rootfstype=nfs rootwait fsck.repair=yes net.ifnames=0 logo.nologo console=tty1 cgroup_enable=memory

  1. Modify the /etc/fstab on the root share (again on the server) to reflect that you’re using NFS filesystems. Something like:
#PARTUUID=0baaf667-02 / ext4 noatime,lazytime,rw 0 1
#PARTUUID=0baaf667-01 /boot vfat noatime,lazytime,rw 0 2 /boot nfs	defaults 0 2 / nfs	defaults,noatime 0 1

I’ll be moving one of my Pi3b+ over to full network boot/root in the next couple weeks.

Thx for sharing. If you like to create a tutorial, you will need to add way more information to each of the steps, on how things need to be configured exactly. Just as a hint :slight_smile:

I did PXE boot on my test RPI3/4 in past and it was working. However, performance was not that good. All r/w operation took ages. Not sure if this was an issue of my Synology NFS server or something else.