Page 1 of 1

After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Posted: 2011/11/04 14:13:14
by musikbyg
Hello!

I changed the configuration for SELinux to disable it, and now I can't get into my Linux box, is in a virtual machine setup and I am very nervous I have lost
all the configurations made so far. Here is a snapshot of the screen:

[img align=left]http://www.affirmativeyou.com/virtual%20machine%20Linux.bmp[/img]

My CentOS 5.7 system will not boot ... I receive a:

Unable to load SELinux Policy. Machine is in enforcing mode. Halting now. Kernel Panic – not syncing : Attempting to kill init!

Then the boot process just stops and does nothing.

Question: Is there a way to recover form this and how do I recover?

Please help.

Thank You

Re: After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Posted: 2011/11/04 15:16:46
by TrevorH
From the grub boot menu you should be able to hit Esc and get a list of the kernels that are available to boot. You can edit the command line parameters for these using grub. First thing to try is to append

[code]
enforcing=0
[/code]

to the end of the current list of parameters. If this fails then try appending selinux=0 instead.

How did you try to disable SELinux to get into this problem in the first place?

Re: After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Posted: 2011/11/04 15:38:04
by musikbyg
I was trying to install the famous Bacula, and one of the instructions I found online said that I needed to disable SElinux temporarily in order to get it to work.
I did, and now I can't get past that error message.
I edited the /etc/selinux/config to a "permissive" state, and now I'm in this mess.

I tried what you suggested, and it didn't work.
Any other suggestions?

Thanks!

Re: After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Posted: 2011/11/04 16:06:01
by musikbyg
I was able to get it back up, THANK YOU

After disabling SELinux, machine not booting up - Unable to

Posted: 2011/11/07 01:49:25
by pschaff
For the sake of readers of this thread and future forum searchers please share your solution.

It is also not clear exactly what you changed to break the system. The usual approach is to just enter "setenforce 0" as root to temporarily disable SELinux by changing to Permissive mode. After performing any required operations then "setenforce 1" (or a reboot) will restore Enforcing mode.

For a permanent change one would use the GUI tool or edit /etc/sysconfig/selinux and change the line "SELINUX=enforcing" to "SELINUX=permissive" or "SELINUX=disabled" (not recommended).

I would have expected the GRUB argument to be "selinux=0".

Re: After disabling SELinux, machine not booting up - Unable to load SELinux Policy. Kernel Halt!

Posted: 2011/11/07 02:02:33
by TrevorH
[quote]
I would have expected the GRUB argument to be "selinux=0".
[/quote]

That disables selinux, 'enforcing=0' should bring it up in permissive mode.

Re: After disabling SELinux, machine not booting up - Unable

Posted: 2014/12/28 15:34:40
by DangerDane
I am having the issue of getting the same error, but I am not wanting to disable SELinux and hasn't changed anything on the system.

Re: After disabling SELinux, machine not booting up - Unable

Posted: 2016/02/09 08:42:00
by centfelgen
Hello,I have the same error with a Vmware-host running Centos7.
After disabling Selinux, my machine does not boot anymore.
During boot I can only choose
CentOs Linux 3.XXXXXXXXXX (core )with debuging
CentOs Linux 3.XXXXXXXXXX (core)
CentOs Linux 7 (core) with Linuxe 3.XXXXXXXXXX
CentOS Linux 7 (Core) with Linux 0 rescue.
In Centos 7 I don’t find how to append enforcing=0
If I choose CentOS Linux 7 (Core) with Linux 0 rescue, the Machine tells me
“Failed to load SELinux policy”
What can I do to start the machine?