I'm building a custom initrd so that I can boot diskless nodes with a tmpfs root rather than NFS root (a script in the initrd copies the contents of the root device to a tmpfs filesystem, then changes the value of
NEWROOT). All seemed well and good in my test environment, I generated a custom initrd, booted it, / mounted from none as tmpfs but had all the files the NFS root provided, great stuff.
Then I started moving towards the real environment, and when the initrd boots it chokes trying to mount the NFS root (which is still a normal NFS boot at that point) complaining
mount.nfs4: No such device.
I generate my initrd using:
dracut -v -m "nfs network base" --include rd.live.overlay/ / initrd-tmpfs.img
I confirmed that the
initrd-tmpfs.img is being loaded (based on the early part of the PXE boot where it lists the initrd its loading).
When the initrd fails it drops into the emergency shell, and has a few interesting things:
ip addr show lists my IP from DHCP, and I can ping the NFS server
echo $netroot lists the NFS boot paramaters
nfs4:[Server IP]:[root location]:[nfs options]
mount -t nfs4 [Server IP]:[root location] /sysroot results:
mount.nfs4: No such device (very familiar)
modprobe nfs results:
modprobe:FATAL: Module nfs not found obviously a problem
grep nfs /usr/lib/dracut/modules.txt does match
grep nfs /usr/lib/modules/[kernel version]/modules.order matches a few times, mentioning:
kernel/fs/nfs.ko | kernel/fs/nfsv3.ko | kernel/fs/nfsv4.ko however none of these exist
Environment: RHEL 7
Looks like my question answered itself just as I finished writing it, I'll post the answer