Using, the selinux =0 and using the pxeboot/vmlinux and pxeboot/initrd.img files fixed this issue. :). Thank you so much for your help. 
@James I am not super clear on how to follow those steps or what is the benefit over using the supplied pxeboot images?


On Tue, Feb 7, 2023 at 2:26 PM James Pearson via rocky <rocky@lists.resf.org> wrote:
I don't believe you need a 'special' pxeboot kernel - but you do need the NFS dracut and kernel modules in the initrd - the initrd supplied in the images sub-directory on the install ISO does have these - although this will limit you to the installer kernel version and not later bug/security fixed versions (that initrd may also have extras used to start the installer which aren't needed?)

You can create your own initrd with dracut that has the required NFS root support - I haven't done this on Rocky 9, but have done so many times with x86_64 CentOS 7 with pxelinux (not UEFI PXE) - but I'm guessing the process is similar?

On CentOS 7, I create the NFS root initrd with something like:

 dracut -m "nfs network base" initrd_file kernel_version

(you may need extra kernel modules included with the '--add-drivers' option depending on your hardware)

You have to have the required kernel version installed - and make sure your NFS root file system has the matching /lib/modules/$kernel_version tree

Your PXE kernel file will then be the /boot/vmlinuz-$kernel_version file and the initrd file as above

James Pearson
________________________________________
From: Louis Abel via rocky <rocky@lists.resf.org>
Sent: 07 February 2023 07:27
To: Rocky Linux General Mailing List
Cc: Louis Abel
Subject: [rocky] Re: netbooting rocky linux : unable to nfs mount the root file system

The kernel is able to mount NFS shares, otherwise you couldn't use an nfs client in normal operations. No recompiling is necessary and not recommended.

With that being said, the immediate things that stick out to me is:

* You are missing selinux=0. A diskless client (which is what you're setting up) cannot run with SELinux enabled if the root disk is on a network filesystem. There's no other way around that.
* You are using the kernel itself, and not pxeboot form of the kernels (you should be using the pxeboot/vmlinux and pxeboot/initrd.img files found on the ISO's or https://dl.rockylinux.org/pub/rocky/9/BaseOS)

I would suggest doing those and then troubleshooting further.

-L

On Mon, 6 Feb 2023 at 23:38, Sandeep Gupta via rocky <rocky@lists.resf.org> wrote:
I have posted this question here as well: https://serverfault.com/questions/1122071/netbooting-centos-via-pxe-and-uefi-unable-to-mount-root-over-nfs-failed-to.

Essentially, the kernel is able to bootup but fails to mount the nfs root device. I am wondering if rocky linux kernel is able to mount nfs shares?
If not, what is the workaround? Would recompile of the kernel with nfs support work?
Below, is the grub entry  for reference
```

set default="0"
set timeout=5
set root=(tftp,192.168.0.185)
set prefix=($root)/grub2

menuentry "OS (UEFI PXE)" {
    linux /vmlinuz-5.14.0-162.6.1.el9_1.aarch64 root=/dev/nfs rw nfsroot=192.168.0.185:/nfs/rpi4_dfd9 rw ip=dhcp rootwait elevator=deadline
    initrd /initramfs-5.14.0-162.6.1.el9_1.aarch64.img
}

```


Thanks

-S
_______________________________________________
rocky mailing list -- rocky@lists.resf.org
To unsubscribe send an email to rocky-leave@lists.resf.org