42

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.

RzR
  • 3,068
  • 29
  • 26
Slayer
  • 2,391
  • 4
  • 21
  • 18
  • 1
    Kernel panics happen for a variety of reasons. Often due to hardware failure... You'll need to check out /var/log/dmesg and /var/log/syslog to get more info about what actually happened. – hsanders Oct 12 '12 at 21:58
  • 1
    You should try to boot using a "Live CD", and then mount the HDD partition that held `/` and `/lib`. Then try to restore the libc files. – sawdust Oct 12 '12 at 23:43
  • 10
    This isn't really the right forum for this question. You're better off asking on superuser.com or ubuntu.stackexchange.com. This question looks like it'll be migrated to superuser.com shortly. – Craig Ringer Oct 13 '12 at 07:40
  • 1
    I've same issue while I dist upgrade from 14.04, I'm even not able to boot with old kernel and rescue more, how did you solve it. ???? – Nullpointer Oct 27 '16 at 15:08
  • I have the same problem. Did you found a solution? Thanks. – Pascut Jul 13 '17 at 14:42
  • This is why I don’t like Ubuntu. Why can’t it just work smoothly. – atulkhatri Jul 18 '20 at 09:29

8 Answers8

24

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 !

Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
gustavodiazjaimes
  • 2,441
  • 1
  • 19
  • 14
3
  1. Mount the centos live cd and boot
  2. Go into rescue mode and wait for it load up
  3. Read the terminal to see where it mounted the OS
  4. Go into OS
  5. vim or nano /etc/selinux/config
  6. Make sure SELINUX=enforcing or disabled
Michael Mikhjian
  • 2,760
  • 4
  • 36
  • 51
2

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

cubbuk
  • 7,800
  • 4
  • 35
  • 62
Foued GR.
  • 21
  • 1
2

Solution is :-

  1. Restart
  2. Go to advanced menu and then click on 'e'(edit the boot parameters)
  3. Go down to the line which starts with linux and press End
  4. Press space
  5. Add the following at the end -> kernel.panic=1
  6. Press F10 to restart

This basically forces your PC to restart because by default it does not restart after a kernel panic.

Pranshu
  • 21
  • 1
1

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).

Ethan Brown
  • 683
  • 6
  • 11
1

Mount remount the /
Eg.

  1. mount -o remount,rw /dev/xyz /
  2. sed -i 's/1 1/0 0/' /etc/fstab
  3. sed -i 's/1 2/0 0/' /etc/fstab
  4. reboot
benka
  • 4,732
  • 35
  • 47
  • 58
1

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

0

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

Community
  • 1
  • 1
Ranjith Ruban
  • 527
  • 2
  • 9
  • 1
    On a Debian based system such as Ubuntu, it would be the .deb's rather than the rpm's. If recovering the system fails, copying off the user data directories before reinstall is another option. Actually, that is the first thing that should be done BEFORE any further attempt at repair. Go to your local office supply, get an external hard drive, boot from a liveCD and back up the user data. Then think about repair. – Chris Stratton Dec 21 '12 at 16:43