#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
Last edited by zjykzk (2020-01-06 04:00:05)
#2 2020-01-06 03:26:24
- fukawi2
- Ex-Administratorino
- From: .vic.au
- Registered: 2007-09-28
- Posts: 6,216
- Website
Re: kernel panic: failed to execute init (error -2)
#3 2020-01-06 04:51:08
- zjykzk
- Member
- Registered: 2020-01-06
- Posts: 4
Re: kernel panic: failed to execute init (error -2)
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)
#4 2020-01-06 05:05:27
- jasonwryan
- Anarchist
- From: .nz
- Registered: 2009-05-09
- Posts: 30,376
- 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
#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. ;(
#6 2020-01-06 06:53:42
- frostschutz
- Member
- Registered: 2013-11-15
- Posts: 1,243
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
#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)
#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?
#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.
Содержание
- Kernel panic: Request init /bin/bash failed (error -2)
- Arch Linux
- #1 2020-01-06 02:46:51
- kernel panic: failed to execute init (error -2)
- #2 2020-01-06 03:26:24
- Re: kernel panic: failed to execute init (error -2)
- #3 2020-01-06 04:51:08
- Re: kernel panic: failed to execute init (error -2)
- #4 2020-01-06 05:05:27
- Re: kernel panic: failed to execute init (error -2)
- #5 2020-01-06 06:14:54
- Re: kernel panic: failed to execute init (error -2)
- #6 2020-01-06 06:53:42
- Re: kernel panic: failed to execute init (error -2)
- #7 2020-01-14 03:42:47
- Re: kernel panic: failed to execute init (error -2)
- #8 2020-02-11 10:18:55
- Re: kernel panic: failed to execute init (error -2)
- #9 2020-02-11 10:43:13
- Re: kernel panic: failed to execute init (error -2)
- Arch Linux
- #1 2015-01-16 12:25:58
- [SOLVED]Kernel panic init error
- #2 2015-01-16 12:39:55
- Re: [SOLVED]Kernel panic init error
- #3 2015-01-16 13:15:20
- Re: [SOLVED]Kernel panic init error
- #4 2015-01-16 15:11:47
- Re: [SOLVED]Kernel panic init error
- #5 2015-01-16 16:59:25
- Re: [SOLVED]Kernel panic init error
- #6 2015-01-17 17:36:24
- Re: [SOLVED]Kernel panic init error
- #7 2015-01-19 20:39:05
- Re: [SOLVED]Kernel panic init error
- «Failed to execute /init (error -2)» when building root #310
- Comments
- Footer
Kernel panic: Request init /bin/bash failed (error -2)
Люди, прошу, помогите Выдает сабж. В grub редактировалпункт меню, к строке дописывал init=/bin/bash теперь это. Что посоветуете? ОС Arch linux
Убери из строки то, что дописал. Выдели пункт меню, нажми клавишу «e», сотри из строки параметров ядра дописанное, затем нажми клавишу «b» или F10 для загрузки, в общем там написано.
Собственно написал я это туда не просто так. Без этого Kernel panic — not syncing: No working init found. Try passing init= option to kernel
Вестимо, если в archlinux нет ссылки /sbin/init -> /usr/lib/systemd/systemd, то у вас это работать не будет. Верните туда то, что было. Если это ваша первая установка Arch Linux, то следуйте согласно wiki странице установки, если это вообще ваш первый Linux, то начните с чего-нибудь проще, например Ubuntu или Fedora.
А так, могу быть нюансы, всё зависит от того где находится корневая файловая система.
Читайте соответствующую wiki страницу и не бездумно копируйте оттуда, а разбирайтесь что и почему сделано так.
очевидно, что что-то с диском/ФС, по крайней мере она не монтируется. или пуста, или повреждена. устройство правильное указываешь? и каким образом? порядковые номера разделов могут меняться, используй UUID или метки.
Вестимо, если в archlinux нет ссылки /sbin/init -> /usr/lib/systemd/systemd, то у вас это работать не будет.
но она есть, и баш тем более. так что проблема явно не в этом.
Значит, скорее всего, ТС ставит на lvm, raid или ещё какой-либо контейнер. В любом случае в шапке ничего не сказано о конфигурации.
Нет, можно конечно устроить гадание на кофейной гуще, но ТС лучше всё же всё описать нормально.
по крайней мере она не монтируется
Нет, тогда сообщение о панике было бы другое («VFS: Unable to mount root fs on unknown-block»).
Но, вообще говоря, если у ТС даже init=/bin/bash не срабатывает, то у него что-то очень не так с системой.
Может, он libc испортил? В любом случае, ТС вообще не написал, после чего и почему у него начались проблемы.
Да. Может быть, что-то случилось с симлинками /lib64 -> /usr/lib.
Источник
Arch Linux
You are not logged in.
#1 2020-01-06 02:46:51
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
Last edited by zjykzk (2020-01-06 04:00:05)
#2 2020-01-06 03:26:24
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
#3 2020-01-06 04:51:08
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
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)
#4 2020-01-06 05:05:27
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.
Registered Linux User #482438
#5 2020-01-06 06:14:54
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.
i had downgraded the kernel and added the option parameter with ‘/sbin/init’. it was all failed.
it produced same error message. ;(
#6 2020-01-06 06:53:42
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
#7 2020-01-14 03:42:47
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
set these files’path in the field FILES in the file /etc/mkinitcpio.conf, then rebuild the initramfs.
Last edited by zjykzk (2020-01-14 03:44:31)
#8 2020-02-11 10:18:55
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
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?
#9 2020-02-11 10:43:13
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.
Источник
Arch Linux
You are not logged in.
#1 2015-01-16 12:25:58
[SOLVED]Kernel panic init error
So this I f*** up really bad. I was in a horry and did not read the output from pacman. Pacman then updated ONLY linux 3.18.2-2. Now my system can not boot because of a init error as far as I could understand from the kernel panic page. I followed some archwiki tutorials on downgrading with arch-chroot, I reconfigured grub because it booted the wrong partition and I redid mkinitcpio. but no matter what I tried nothing worked.
The first line of the kernel panic error is: Failed to execute /init (error -2)
second line: Kernel panic — not syncing: no working init found. try passing init= option to kernel. See linux documentation/init.txt for guidance.
Any help is super appreciated
— Cheers Sebbe
Last edited by sebkirller (2015-01-21 15:55:57)
#2 2015-01-16 12:39:55
Re: [SOLVED]Kernel panic init error
So try passing an init option. I’d start with init=/usr/lib/systemd/systemd. If this works, check the output of `ls -l /usr/bin/init`, if it fails you can use init=/usr/bin/bash. Then you can check is systemd is actually there and if needed mount partitions and run pacman.
Also, if you can describe what actually happened better we could provide better suggestions. Upgrading the kernel only would not cause such problems. Downgrading the kernel also wouldn’t.
«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman
#3 2015-01-16 13:15:20
Re: [SOLVED]Kernel panic init error
So try passing an init option. I’d start with init=/usr/lib/systemd/systemd. If this works, check the output of `ls -l /usr/bin/init`, if it fails you can use init=/usr/bin/bash. Then you can check is systemd is actually there and if needed mount partitions and run pacman.
Also, if you can describe what actually happened better we could provide better suggestions. Upgrading the kernel only would not cause such problems. Downgrading the kernel also wouldn’t.
I am sorry my description was inaccurate. What I ment by it was that I updated my system with pacman -Syu and did not read what updated and just went to do something els. When I came back I saw that the kernel had been upgraded from 3.17 to 3.18 without the 3.18 linux-headers packages. After I rebooted I was presented with the kernel panic. Then I downgraded again but the problem persisted. I hope this describes my mistake better.
Both init commands gives me this output: «failed to execute /usr/lib/systemd/systemd (error -2). attempting defaults. » and «failed to execute /usr/bin/bash (error -2). Attempting defaults. «
#4 2015-01-16 15:11:47
Re: [SOLVED]Kernel panic init error
I suspect your bootloader is mounting the wrong root partition. Can you post your bootloader config?
«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman
#5 2015-01-16 16:59:25
Re: [SOLVED]Kernel panic init error
Also, tell us about your disks and partitions. Are you using a single disk?, multiple disks? RAID? What are your file systems? Is your boot partition a separate partition?
Is there any chance the boot partition was not mounted when you did your update?
What do you mean by the kernel being updated without having updated the headers?
Anyway, don’t panic. You might want to read the wiki article on chroot. I think we may use that method to get you back to a working system.
Nothing is too wonderful to be true, if it be consistent with the laws of nature — Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. — Alan Turing
—
How to Ask Questions the Smart Way
#6 2015-01-17 17:36:24
Re: [SOLVED]Kernel panic init error
Here is a link to pastebin wit my grub.cfg file: http://pastebin.com/gzqraKPr
I have one HDD and one SSD. The SSD is windows dedicated only. The HDD is split with half for windows and the other half for linux. The bit for linux is partitioned with separate root and home partitions. The root file system is xfs and the home partition btrfs. As far as I could understand the packages linux 3.18.2-2 requires linux-headers 3.18.2-2, which did not get downloaded because it was not uploaded until maybe 1 minute later. As for the chroot I am totally in for that as I already tried fixing grub from the arch boot cd with arch-chroot after I saw that my partitions were mounted incorrectly.
#7 2015-01-19 20:39:05
Re: [SOLVED]Kernel panic init error
So this I f*** up really bad. I was in a horry and did not read the output from pacman. Pacman then updated ONLY linux 3.18.2-2. Now my system can not boot because of a init error as far as I could understand from the kernel panic page. I followed some archwiki tutorials on downgrading with arch-chroot, I reconfigured grub because it booted the wrong partition and I redid mkinitcpio. but no matter what I tried nothing worked.
The first line of the kernel panic error is: Failed to execute /init (error -2)
second line: Kernel panic — not syncing: no working init found. try passing init= option to kernel. See linux documentation/init.txt for guidance.
Any help is super appreciated
— Cheers Sebbe
I had the exactly the same strange problem.
The problem is that /usr/lib64/ should be a symbolic link to the /usr/lib/, but it was a folder containing something (for me kde4/kcm_adobe_flash_player.so), also move the folder lib64 somewhere, reinstall package «filesystem» and redo makeinitcpio.
After that, /usr/lib64 become a link to /usr/lib and the generated /boot/initramfs-linux.img contains all libraries needed to boot, systemd as well!
Also, boot the system with arch-live usb stick and at prompt :
Remove usb stick and at GRUB enjoy the resumed Arch
——
Источник
«Failed to execute /init (error -2)» when building root #310
Making root on the native host architecture (x86_64) and running with the qemu script on the host directory throws error -2.
The output:
For the build environment I’m using ubuntu 20.04 with qemu 4.2.1.
The toybox release was just cloned from master and I’m using the version 5.16.0-rc6 of the kernel.
I’ve also tried adding init=/init as KARGS, it doesn’t seem to make a difference.
The text was updated successfully, but these errors were encountered:
I’m assuming you used mkroot here? With a LINUX= kernel?
According to /usr/include/asm-generic/errno-base.h error 2 is ENOENT «No such file or directory». It’s saying your filesystem hasn’t got an /init in it, although what the kernel might be complaining about is the #!/bin/sh it points to is what’s missing. (Does your toybox .config not have CONFIG_SH enabled in it? I.E. the warning in last paragraph of https://landley.net/toybox/faq.html#mkroot ?) The third option for the kernel loader giving that error would be the /bin/sh the #! line tries to load is dynamically linked and it can’t find the ld-linux.so it points to, but mkroot only produces a static toybox.
Saying init=/init won’t help for two reasons: 1) that’s what it already tried, 2) that’s the init for the fallback root mount if there’s no initramfs, the initramfs init is «rdinit=/init». (Ask the kernel guys why they’re different, not me. )
Most likely «rm .config && LINUX=$LOCATION scripts/mkroot.sh» would fix it. You built an existing defconfig and didn’t let mkroot create a .config with the extra two commands from pending (sh and route). Once I get those two finished/promoted that should be less of a problem because then they’d be in defconfig already.
Hi Rob, it seems, that, somehow one of the build-essential components got corrupted and an invalid binary was built.
I just needed to reinstall the package.
Thank you for your assistance.
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
View previous topic :: View next topic | |||||||||||||||||
Author | Message | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
willem-jan n00b Joined: 12 Sep 2021 |
|
||||||||||||||||
Back to top |
|
||||||||||||||||
alamahant Advocate Joined: 23 Mar 2019 |
|
||||||||||||||||
Back to top |
|
||||||||||||||||
willem-jan n00b Joined: 12 Sep 2021 |
|
||||||||||||||||
Back to top |
|
||||||||||||||||
mike155 Advocate Joined: 17 Sep 2010 |
|
||||||||||||||||
Back to top |
|
||||||||||||||||
alamahant Advocate Joined: 23 Mar 2019 |
|
||||||||||||||||
Back to top |
|
||||||||||||||||
Hu Moderator Joined: 06 Mar 2007 |
|
||||||||||||||||
Back to top |
|
||||||||||||||||
willem-jan n00b Joined: 12 Sep 2021 |
|
||||||||||||||||
Back to top |
|
||||||||||||||||
willem-jan n00b Joined: 12 Sep 2021 |
|
||||||||||||||||
Back to top |
|
||||||||||||||||
mike155 Advocate Joined: 17 Sep 2010 |
|
||||||||||||||||
Back to top |
|
||||||||||||||||
Hu Moderator Joined: 06 Mar 2007 |
|
||||||||||||||||
Back to top |
|
||||||||||||||||
|
You cannot post new topics in this forum |
Attaching a bit more of the boot log.
HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
iommu: Default domain type: Translated
iommu: DMA domain TLB invalidation policy: strict mode
SCSI subsystem initialized
EDAC MC: Ver: 3.0.0
clocksource: Switched to clocksource arch_sys_counter
workingset: timestamp_bits=62 max_order=19 bucket_order=0
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler mq-deadline registered
cacheinfo: Unable to detect cache hierarchy for CPU 0
brd: module loaded
VFS: Mounted root (tmpfs filesystem) on device 0:15.
Freeing unused kernel memory: 704K
Run /init as init process
with arguments:
/init
with environment:
HOME=/
TERM=linux
Kernel panic - not syncing: Requested init /init failed (error -2).
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.0-rc7-00001-g8d7daa446b53-dirty #33
Call trace:
dump_backtrace+0x0/0x1d0
show_stack+0x14/0x20
dump_stack_lvl+0x64/0x7c
dump_stack+0x14/0x2c
panic+0x158/0x304
kernel_init+0xf0/0x150
ret_from_fork+0x10/0x20
Kernel Offset: disabled
CPU features: 0x00001001,20000802
Memory Limit: none
---[ end Kernel panic - not syncing: Requested init /init failed (error -2). ]---
I am building an embedded linux OS for an experimental FPGA platform. I used upstream U-boot(boot-loader), linux(kernel) and buildroot(just for filesystem).
I followed some examples and enabled the required initrd/initramfs support in my linux config.
CONFIG_BLK_DEV_INITRD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=10240
I used the bootm command in u-boot to load a FIT image that comprises of the linux kernel, dtb and the rootfs.cpio(compiled from buildroot). Relevant info here: FIT test
These are the bootargs passed to the kernel:
console=ttyS0,9600 earlyprintk maxcpus=1 earlycon root=/dev/ram init=/init rw rootfstype=tmpfs debug
Note:
Couple of other things I tried , but resulted in the same error.
- Passing the kernel,dtb and fs image separately.
- Tried passing init=/bin/sh , /sbin/init , /etc/init , /bin/init
- Tried a basic initramfs with just an init script , simple directory structure and a separately compiled busybox placed in /bin/busybox with symbolic links.
- Rather than passing an external FS, I passed the path to the initramfs source and compiled it into the kernel with CONFIG_INITRAMFS_SOURCE.
I would appreciate any feedback/pointers on what I could be missing, been stuck on this for while now.
I am brand new to Linux so I have no clue what any of the error message means in the slightest. The message I am getting is:
[0.424931] Initramfs unpacking failed: no cpio magic
[0.984686] Failed to execute /init (error -2)
[0.984730] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[0.984789] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.4.0-26-generic #30-Ubuntu
[0.984789] Hardware name: MotherBoard By ZOTAC MotherBoard Z77ITX-A-E/Z77ITX-A-E, BIOS A229P007 06/05/2012
[0.984816] Call Trace:
[0.984840] dump_stack+0x6d/0x9a
[0.984862] ? rest_init+0x30/0xb0
[0.984883] panic+0x101/0x2e3
[0.984904] ? do_execve+0x25/0x30
[0.984924] ? rest_init+0xb0/0xb0
[0.984965] kernel_init+0xfb/0x100
[0.984965] ret_from_fork+0x35/0x40
[0.985039] Kernel Offset: 0x17600000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[0.985069] ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. ]---
I looked at https://www.kernel.org/doc/Documentation/admin-guide/init.rst and it really didn’t help me at all because of how new I am to Linux. I am installing with a USB drive and I have tried every USB port on my computer (USB 3 and 2).
asked May 13, 2020 at 10:12
Just in case you didn’t resolve it and/or anyone else is wondering — I was having the same issue with Server 20.04 when I was running 512MB of RAM in an old Lenovo desktop (oldest AMD64 machine I’ve ever seen — had to disable APIC & LAPIC). Taking out the 512MB and dropping in 2GB of RAM solved the issue and doesn’t crash the installer with a kernel panic.
Classic case of a not-so-helpful (although probably accurate) error message. Hope this helps!
answered Jun 27, 2020 at 1:43
1
My solution is that you remove one of your RAM. I had 3gb of ram and took out 1gb…boom everything worked perfectly.
answered Sep 10, 2021 at 1:34