1

I've recently been transitioning the various Raspberry Pis on my (wired) network over to use NFS root filesystems rather than mounting them from the SD cards, to avoid the assorted known problems with SD card life, add ease of backup, etc.

But now in the process of transitioning I've come to my couple of Pi Zero Ws, hence my question - can I mount an NFS root partition over wlan0 in the same way as I can over eth0 on my other Pis? I don't see any reason why, in theory,

console=serial0,115200 console=tty1 root=/dev/nfs nfsroot=172.16.0.24:/node-fs/endercam,vers=4.1,proto=tcp rw ip=dhcp rootfstype=nfs elevator=deadline rootwait

shouldn't work just as well for the Zero as for anything else, but presumably I will need to provide the WiFi network credentials somewhere in there, if it is possible?

(Note: I'm not currently trying to network boot the Pis; I have left the /boot partion on the SD card and boot off that, then mount the root filesystem over NFS, rather than do a full PXE boot. I understand that the latter isn't possible over WiFi anyway.)

1 Answer 1

2

I assume you are using the Raspberry Pi OS. You want to boot the kernel from the SD Card because network booting the kernel with WiFi isn't possible. But you want to use the root partition from an NFS export. This could be possible if the remote filesystem is available before the kernel switches to the root filesystem.

As you can see at bootup — System bootup process, switching to the root filesystem is done after the basic.target. But with this target the needed remote-fs.target isn't available. This is initialized parallel and defined to be available before the multi-user.target. That's too late.

So following this interpretation of the booting diagram it is not possible to boot with a nfsroot over a wireless network.

I'm not sure if the kernel is able to connect to the NFS export only with its kernel parameter or if it needs the PXE support from the network interface card and when needed if it can use it without PXE boot.

5
  • I was mostly booting from the SD card for now even for the wired Pis because at the moment I'm just looking at saving wear and tear on SD cards by moving the root fs, and I might as well leave setting up PXE booting for later. Although I am aware that you can't PXE-boot over wireless networks.
    – Cerebrate
    Jun 25, 2020 at 22:06
  • But by the standard bootup process, as I understand it, you shouldn't be able to boot with an nfsroot on a wired network, either, since you shouldn't be able to mount the NFS rootfs until after dhclient has assigned an IP address to talk to the server with - but the ip option for the kernel command line moves that task to the kernel. I was hoping there was an equivalent somewhere for connecting to the wireless LAN, but I guess not?
    – Cerebrate
    Jun 25, 2020 at 22:12
  • @Cerebrate I'm not sure if the kernel is able to connect to the NFS export only with its kernel parameter or if it needs the PXE support from the network interface card and when needed if it can use it without PXE boot.
    – Ingo
    Jun 26, 2020 at 23:28
  • interesting idea though... would this require a firmware change?
    – Seamus
    Jun 29, 2020 at 22:01
  • @Cerebrate I don't know, just an idea. I do not have the environment available/setup to examine it.
    – Ingo
    Jun 30, 2020 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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