The title is the intro: I realy need some linux experts on this one, this is not an obvious one or at least to me its not. I have a pretty good idea of how to do this and have done so before but this time around I am missing something. in this case my pxe image's fail to boot with a failed to switch root.
What I have done to create the current images I have tried:
Installed and setup a linux redhat version 7 on target hardware.
created a custom initramfs with "nfs" and "network" modules included (so this image boots and works from the on board hardrive.
used rsync cmd to copy over the root file system and then put my custom initramfs and the matching kernel in the tftpboot server for pxe.
Cleared the fstab file and commented out the uuid of the harddrive and tried both(fstab empty or fstab with root mounted on nfs)
changed the permissons on the initramfs and vmlinuz
setup an nfs server service and put the root file system as exportable with no_root_squash and rw
issues I'm having: The image will pxe over and run the vmlinuz and then the initramfs but fails once it gets to the switch root service. It drops me in a dracut shell after a time and I looked at the dracut report /run/initramfs/rdsosreport.txt and one line had the following
Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing initrd-switch-root.service: Main Process exited, code=exited, status=1/FAILURE
I have looked and the os-release file is there and is the same as the one on the working image on the target hardware's hardrive(which successfully boots every time).
the root files system is there and pointed to apropriatley via the correct absolute path and here is my pxelinux.cfg default line for it
also when this line was wrong or incorrect in the past I would get a dracut fatal error with dracut does not know how to handle root=nfs... etc or if the rootfilesystem was not available because of wrong path or permissions it would spit out a inadequate permissions error.
I also have noticed that I lose connectivity with the pxe server during the switch root which is maybe why it is failing since the root is over nfs, but it has the nfs and network modules other wise the initramfs would fail before switch-root.service ? so I am left puzzled why I loose connection at this point. Especially since the image the pxe image was created from does have nfs up and enabled for on boot .
I have researched this to no avail if someone can point out what I am doing wrong or help me discover the source of the issue I would be tremendously grateful.