You are not logged in.

#1 2020-01-06 02:46:51

zjykzk
Member
Registered: 2020-01-06
Posts: 4

kernel panic: failed to execute init (error -2)

after upgrading the kernel to 5.4.7, the system cannot boot. it output the following message:

i have no idea now, thx

Wechat-IMG410.jpg

Last edited by zjykzk (2020-01-06 04:00:05)

Offline

#2 2020-01-06 03:26:24

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,223
Website

Re: kernel panic: failed to execute init (error -2)

Start by booting the install ISO, chroot'ing into your install and re-running mkinitcpio
https://wiki.archlinux.org/index.php/Ch … rch-chroot

Also: https://wiki.archlinux.org/index.php/Ge … nel_panics

Offline

#3 2020-01-06 04:51:08

zjykzk
Member
Registered: 2020-01-06
Posts: 4

Re: kernel panic: failed to execute init (error -2)

fukawi2 wrote:

Start by booting the install ISO, chroot'ing into your install and re-running mkinitcpio
https://wiki.archlinux.org/index.php/Ch … rch-chroot

Also: https://wiki.archlinux.org/index.php/Ge … nel_panics

i just executed the command `mkinitcpio -p linux`, the kernel is also panic.

anything else to do ? thx

Last edited by zjykzk (2020-01-06 04:55:59)

Offline

#4 2020-01-06 05:05:27

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: kernel panic: failed to execute init (error -2)

Did you try and follow the advice of the error message and explicitly pass your init location as a kernel parameter?

And just rebuilding the intramfs and hoping is not much of a strategy. Read your logs and see what happened during the upgrade. Try downgrading the kernel. Try helping yourself.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2020-01-06 06:14:54

zjykzk
Member
Registered: 2020-01-06
Posts: 4

Re: kernel panic: failed to execute init (error -2)

jasonwryan wrote:

Did you try and follow the advice of the error message and explicitly pass your init location as a kernel parameter?

And just rebuilding the intramfs and hoping is not much of a strategy. Read your logs and see what happened during the upgrade. Try downgrading the kernel. Try helping yourself.

i had downgraded the kernel and added the option parameter with '/sbin/init'. it was all failed.

it produced same error message. ;(

Offline

#6 2020-01-06 06:53:42

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: kernel panic: failed to execute init (error -2)

it found /init (of the initramfs) but there is some problem with it (syntax error or anything) so something wrong with your initramfs

to figure out what's going on you might have to take a look at it directly

Offline

#7 2020-01-14 03:42:47

zjykzk
Member
Registered: 2020-01-06
Posts: 4

Re: kernel panic: failed to execute init (error -2)

fixed, some so file is missing in the initramfs-linux.img file

the checking command is

mkdir /tmp/foo
cd /tmp/foo
zcat /boot/initramfs-linux.img  | cpio -i
chroot . /bin/sh

set these files'path in the field FILES in the file /etc/mkinitcpio.conf, then rebuild the initramfs.

it's done

Last edited by zjykzk (2020-01-14 03:44:31)

Offline

#8 2020-02-11 10:18:55

robert.next
Member
Registered: 2016-08-24
Posts: 3

Re: kernel panic: failed to execute init (error -2)

frostschutz wrote:

it found /init (of the initramfs) but there is some problem with it (syntax error or anything) so something wrong with your initramfs

to figure out what's going on you might have to take a look at it directly

I'm facing the same issue now that I've upgraded to 5.5.2... (and all the other kernel options are broken the same way) would you mind letting us know what was the missing file (.so lib?) on your initramfs?

Is this a systemic issue? (ie. broken mkinicpio scripts) or this is a weird occurrence due some rootfs differences?

Offline

#9 2020-02-11 10:43:13

robert.next
Member
Registered: 2016-08-24
Posts: 3

Re: kernel panic: failed to execute init (error -2)

Actually I've just found what my problem was.

Part of the linux drivers for my scanner overwrote the /usr/lib64 from being a symlink, hence when creating the initramfs some so files (thanks zjykzk) might have gone missing. So removing those offending files , recreating the symlink and regenerating the mkinitcpio my system booted again.

Offline

#10 2023-05-26 17:22:24

Bachsau
Member
Registered: 2016-12-09
Posts: 16

Re: kernel panic: failed to execute init (error -2)

Thanks! This just got my system working again after hours of searching, initramfs-rebuilding and downgrading of packages, because I couldn't figure out why the init was failing. And of course `mkinitcpio` doesn't complain, because it's always better to leave the user with an unbootable system.

For the search engines: Kernel panic / No working init found is caused by the Brother Scanner Driver replacing a symlink with an actual directory. Because what could possibly go wrong? roll

Last edited by Bachsau (2023-05-26 17:23:46)

Offline

#11 2023-05-26 22:46:11

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: kernel panic: failed to execute init (error -2)

Closing this old thread (the OP has not been back since 2020).

Offline

Board footer

Powered by FluxBB