Rocky Linux 9.4 won't boot due to Corrupted SELinux policies help

Hi all,
Me again.

I opened /etc/selinux/config and change it to SELINUX=permissive. After I reboot, I get an error “Failed to load SELinux policy, freezing.”

I tried to follow help articles but my GRUB menu looks completely different.
http://blog.aristadba.com/2021/03/failed-to-load-selinux-policy-freezingsolved/

What are the instructions for Rocky Linux 9.4 with GRUB




Here are some pictures to illustrate my problem. I would appreciate any help to fix it.

  • How to reset it to default?
  • Can we set SELINUX=disabled and still be able to boot into Linux?
  • Could one way to fix it be to boot into a bootable USB of Ubuntu and edit the file from there and then boot back into Rocky Linux as normal?

Thanks

I booted into a Rocky Linux 9.4 USB and entered Rescue Environment. I press option 1 and then saw a message;

“Your system has been mounted under /mnt/sysroot.
If you would like to make the root of your system the root of the active system, run the command:
chroot /mnt/sysroot”

  • I access system by running the command chroot /mnt/sysroot
  • To disable SELinux temporarily: setenforce 0
  • To revert the SELinux configuration: nano /etc/selinux/config
  • I changed the line to targeted
  • sudo reboot

It tried to boot but ran into an issue where it needed to autorelabel something

It reboot again and worked

Next time you can try to press e while in the boot menu and add the following parameter selinux=0. It should disable selinux for the current boot only.
If this should not work, you can add the kernel parameter init=/bin/bash to spawn a shell, instead of booting the whole system.
If you use this rescue methods to change files, you need to create an empty file called .autorelabel within the / directory for selinux to appropriately label the files you have changed.

2 Likes