After accepting to a kernel update my system stopped functioning.
Commands on the terminal (like ls
, cd
, etc.) were not working and returned an error message command not found
, as well as trying to use the GUI for any action.
I forcefully shut down the computer and after rebooting I (expectedly) got a kernel panic error:
[timestamp]Kernel panic - not syncing: Attempted to kill init! exitcode=0x0001000
[timestamp]CPU: 0 PID: 1 Comm: run-init Not tainted 3.19.0-25-generic #26~14.04.1-Ubuntu
[timestamp]Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./B150M Pro4S, BIOS P1.10 07/16/2015
[timestamp] ffff88084cd60380 ffff880851727e68 ffffffff817aed00 0000000000002478
[timestamp] ffffffff81a901a8 ffff880851727ee8 ffffffff817a8bc8 ffff880851728000
[timestamp] ffffffff00000010 ffff880851727ef8 ffff880851727e98 ffffffff81c5ee20
[timestamp] Call Trace:
[timestamp] [<ffffffff817aed00>] dump_stack+0x45/0x57
[timestamp] [<ffffffff817a8bc8>] panic+0xc1/0x1f5
[timestamp] [<ffffffff81077ae1>] do_exit+0xa11/0xb00
[timestamp] [<ffffffff81077c17>] SyS_exit+0x17/0x20
[timestamp] [<ffffffff817b668d>] system_call_fastpath+0x16/0x1b
[timestamp] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range:0xffffffff80000000-0xffffffffbfffffff)
[timestamp] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0001000
I didn't panic (hope you like the pun) and looked for possible solutions online, amongst which I found:
- Kernel Panic - Not syncing: Attempted to kill init! exitcode=0x00000009
- Diagnosis: New kernel version has bug.
- Suggested Solution: wait for fix, use previous version.
The problem with this approach is that somehow the new kernel seems to have messed up the old one, and if and when I use the GRUB menu to select a previous version (both in regular and recovery mode) the new kernel gives the exact same error.
- Cannot boot because: Kernel panic - not syncing: Attempted to kill init!
- Diagnosis: Missing
/sbin/init
file - Solution: Use LiveOS to look for
/sbin/init
file, try to add it if missing.
My error is similar, as the run-init
command is not working, but not because a file is missing. Similarly to the OP's case, my disk is working fine and if I access the device from a LiveOS I'm able to find all the binary directories and files.
- https://www.deep-silver.com/kernel-panic-syncing-attempted-to-kill-init/
- https://stackoverflow.com/questions/12867591/how-to-solve-kernel-panic-not-syncing-attempted-to-kill-init-without-er
- Diagnosis: If you just upgraded your Linux or played with SELinux while trying to remove or disable it.
- Suggested Solution: Boot system through grub command line and disable variables related to
selinux
.
The links refer to different systems so I adapted the solution as follows, once I started the GRUB
command line:
grub> set root=(hd0,1) selinux=0 enforcing=0
grub> linux /boot/vmlinuz-3.19.0-25-generic root=/dev/sda1
grub> initrd /boot/initrd.img-3.13.0-29-generic
grub> boot
Not really suggesting a solution, but pointing out multiple possible diagnosis none of which seem to fit my problem.
Sort of unrelated to the kernel panic, but explains how to boot into single user mode from within the GRUB menu. This prevents the X Server
from being launched and hopefully would allow me to run the kernel.
At this point I found many diagnosis, tried many solutions and nothing worked.
What I (think I) understand:
- The kernel (both new and old, recovery mode or not) is having a problem running the
run-init
command. - This has nothing to do with my HW, as the computer works fine with a LiveOS, and I am able to use graphics card, access my disk, use keyboard and mouse.
- This error is in the early stages of booting, as trying to boot into single-user mode does not work and preventing the
X server
to load has no effect.
What I would like to understand, in order of importance:
- Is it possible that a new kernel install overwrites / messes-up the old kernel?
- Is anyone aware of something I'm missing / other solutions?
- Did I do any mistake in implementing the above solutions?
- Is there anything that I haven't tried that comes off the top of your head?
- Can I install a new kernel without formatting everything from the GRUB console?
- Is it time to reinstall the OS? (If you can't answer the ones above I already know the answer to this one...)
Further readings
command not found
errors before i decided to turn the system off. Can you point me to that question? Also, I tried all the options and none of them works...