问题
I was trying to update libc in our Ubuntu server but it failed and now when I reboot the server I get a error message:
Kernel panic - not syncing - Attempted to kill init!
and it just hangs.
What is the solution to this problem? The server is used by 10 people so I don't want to reinstall erasing their data.
回答1:
if the full message is:
kernel panic - not syncing: Attempted to kill inint !
PId: 1, comm: init not tainted 2.6.32.-279-5.2.e16.x86_64 #1
then you should have disabled selinux and after that you have rebooted the system.
The easier way is to use a live OS and re-enable it
vim /etc/selinux/config
...
SELINUX=enforcing
...
Second choice is to disable selinux in the kernel arguments by adding selinux=0
vim /boot/grub/grub.conf
...
kernel /boot/vmlinuz-2.4.20-selinux-2003040709 ro root=/dev/hda1 nousb selinux=0
...
source kernel panic - not syncing: Attempted to kill inint !
回答2:
- Mount the centos live cd and boot
- Go into rescue mode and wait for it load up
- Read the terminal to see where it mounted the OS
- Go into OS
- vim or nano /etc/selinux/config
- Make sure SELINUX=enforcing or disabled
回答3:
I just came across this problem when I replaced a failing disk. I had copied over the system files to the new disk, and was good about replacing the old disk's UUID entry with the new disk's UUID in fstab.
However I had not replaced the UUID in the grub.conf (sometimes menu.lst) file in /boot/grub. So check your grub.conf file, and if the "kernel" line has something like
kernel ... root=UUID=906eaa97-f66a-4d39-a39d-5091c7095987
it likely has the old disk's UUID. Replace it with the new disk's UUID and run grub-install (if you're in a live CD rescue you may need to chroot or specify the grub directory).
回答4:
Mount remount the /
Eg.
mount -o remount,rw /dev/xyz /
sed -i 's/1 1/0 0/' /etc/fstab
sed -i 's/1 2/0 0/' /etc/fstab
- reboot
回答5:
Solution is :-
- Restart
- Go to advanced menu and then click on 'e'(edit the boot parameters)
- Go down to the line which starts with linux and press End
- Press space
- Add the following at the end -> kernel.panic=1
- Press F10 to restart
This basically forces your PC to restart because by default it does not restart after a kernel panic.
回答6:
Booting from CD to rescue the installation and editing /etc/selinux/config: changed SELINUX from enforcing to permissive. Rebooted and system booted
/etc/selinux/config
before change:
SELINUX=enforcing and SELINUXTYPE=permissive
/etc/selinux/config
after change:
SELINUX=permissive and SELINUXTYPE=permissive
回答7:
At grub screen goto boot in recovery.
As booting hold ESC
It should take you into a gui menu. Open command and fix selinux.
Also I suggest run the clean broken packages
回答8:
Use Rescue mode with cd and mount the filesystem. Try to check if any binary files or folder are deleted. If deleted you will have to manually install the rpms to get those files back.
https://askubuntu.com/questions/92946/cannot-boot-because-kernel-panic-not-syncing-attempted-to-kill-init
来源:https://stackoverflow.com/questions/12867591/how-to-solve-kernel-panic-not-syncing-attempted-to-kill-init-without-er