Rocky 9 kernel-5.14.0-70.17.1.el9_0.x86_64 System falls to boot

After updating the kernel on rocky 9 on a new install it fails to boot, system falls in to emergency mode due initrd-switch-root.service entered failed state.

I am able to select the older kernel to get it to boot fine.

I did find this on the Redhat forums
https://access.redhat.com/solutions/4973191

but this is for 7.5 I am unable to find anything about this on 9

I have removed
dnf remove kernel-5.14.0-70.17.1.el9_0.x86_64 kernel-core-5.14.0-70.17.1.el9_0.x86_64 kernel-devel-5.14.0-70.17.1.el9_0.x86_64 kernel-modules-5.14.0-70.17.1.el9_0.x86_64
to get rid of the offending kernel

If you are running dnf update during a kickstart in the %post section, this is a known issue. Running a dnf update after a kickstart should work normally.

[label@awx ~]$ uname -r
5.14.0-70.17.1.el9_0.x86_64

Yes I did issue a dnf update -y in my %post script in my kickstarter
thanks for the info I did not find that in my search.

Yeah this issue affects stream 9 also. I’m actually writing up a bug report as we speak upstream to see if there’s documentation that explains this weird behavior. As a work around, you can probably do this (untested at the moment):

yum update -y
source /etc/default/grub
NEWKER=$(grubby --default-kernel)
grubby --args="${GRUB_CMDLINE_LINUX}" --update-kernel="${NEWKER}"
grubby --remove-args="inst.repo inst.stage2 ip inst.ks" --update-kernel="${NEWKER}"

There is a comment on the red hat bugzilla that alludes to this behavior too: 1969362 – grubby: apply current arguments to future kernels - so even with the above, the root=… parameter isn’t being populated in /etc/default/grub, so my script above wouldn’t cut it.

As an additional edit, doing the below seemed to work, but it expects you to know what the volume/partitions/uuid’s are and such. If you’re doing kickstart installs, it’s likely you’ll know this information.

yum update -y
source /etc/default/grub
NEWKER=$(grubby --default-kernel)
grubby --args="root=/dev/mapper/rockyvg-root ${GRUB_CMDLINE_LINUX}" --update-kernel="${NEWKER}"
grubby --remove-args="inst.repo inst.stage2 ip inst.ks" --update-kernel="${NEWKER}"