You are not logged in.

#1 2023-07-22 07:02:38

ranurag
Member
Registered: 2023-07-21
Posts: 59

kernel failed to execute /init. Not booting.

Error: "Failed to execute /init (error -2)
Kernel panic - not syncing : No working init found. Try passing init= option  to kernel.

--------------------------------------
INFO:  ( by arch-chroot)
---------------------------------------
># stat /bin/init

File: bin/init -> ../lib/systemd/systemd
Size: 22              Blocks: 0          IO Block: 4096   symbolic link
Device: 254,0   Inode: 5636538     Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-07-21 22:30:58.720212312 +0530
Modify: 2023-07-21 02:03:54.000000000 +0530
Change: 2023-07-21 22:25:40.929924869 +0530
Birth: 2023-07-21 22:25:40.929924869 +0530

If i have init file as linked to the systemd file (correct) then. Why kernel is unable to find it ?

># less /etc/fstab

# /dev/mapper/r00t
UUID=43df82b8-a079-4378-b253-0a40a263129a       /               ext4            rw,noatime      0 1

# /dev/sda1
UUID=CFC5-EC21          /boot           vfat            rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro    0 2

# /dev/sda2
UUID=2b6bd4f2-34bb-471c-8433-95487755916c       none            swap            defaults        0 0

>#ls /boot

EFI  initramfs-linux-fallback.img  initramfs-linux.img  loader  vmlinuz-linux  xen-4.17.0.config  xen-4.17.0.gz

># ls /run
empty no result.

Offline

#2 2023-07-22 12:58:41

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,501

Re: kernel failed to execute /init. Not booting.

sudo lsinitcpio /boot/initramfs-linux.img |& grep -E '(init|systemd)'

Offline

#3 2023-07-22 13:32:40

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

Thank you Seth for the reply,
this is the result of it.

etc/initrd-release
init
init_functions
usr/bin/init
usr/bin/run-init
usr/bin/systemd-tmpfiles
usr/lib/modprobe.d/systemd.conf
usr/lib/systemd/
usr/lib/systemd/systemd-udevd
usr/lib/udev/rules.d/11-dm-initramfs.rules

Offline

#4 2023-07-22 13:35:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,501

Re: kernel failed to execute /init. Not booting.

No usr/lib/systemd/libsystemd-shared-* ?
What about the initramfs-linux-fallback.img and what does your mkinitcpio.conf look like?
Also from the chroot:

ldd /bin/init
ls -l /usr/lib/systemd/libsystemd-*
pacman -Qikk systemd

Offline

#5 2023-07-22 13:39:57

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

I think due to "xen" it happens so I did "make clean"  to it and also delete there files from boot. Now my boot contains.

># ls boot

EFI   initramfs-linux-fallback.img  loader  grub  initramfs-linux.img           vmlinuz-linux

But still got the same result.

Offline

#6 2023-07-22 13:44:55

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

># ldd /bin/init

 not a dynamic executable 

># ls -l /usr/lib/systemd/libsystemd-*

-rwxr-xr-x 1 root root 2078992 Mar 30 00:11 /usr/lib/systemd/libsystemd-core-253.2-1.so
-rwxr-xr-x 1 root root 3651432 Mar 30 00:11 /usr/lib/systemd/libsystemd-shared-253.2-1.so

># pacman -Qikk systemd

Licenses        : GPL2  LGPL2.1
Groups          : None
Provides        : nss-myhostname  systemd-tools=253.2  udev=253.2
Depends On      : acl  libacl.so=1-64  bash  cryptsetup  libcryptsetup.so=12-64  dbus  iptables  kbd  kmod  libkmod.so=2-64  hwdata  libcap  libcap.so=2-64  libgcrypt  libxcrypt  libcrypt.so=2-64  systemd-libs  libidn2  lz4  pam  libelf
                  libseccomp  libseccomp.so=2-64  util-linux  libblkid.so=1-64  libmount.so=1-64  xz  pcre2  audit  libaudit.so=1-64  openssl  libcrypto.so=3-64  libssl.so=3-64
Optional Deps   : libmicrohttpd: systemd-journal-gatewayd and systemd-journal-remote [installed]
                  quota-tools: kernel-level quota management
                  systemd-sysvcompat: symlink package to provide sysvinit binaries [installed]
                  systemd-ukify: combine kernel and initrd into a signed Unified Kernel Image
                  polkit: allow administration as unprivileged user [installed]
                  python: Unified Kernel Image with ukify [installed]
                  curl: systemd-journal-upload, machinectl pull-tar and pull-raw [installed]
                  gnutls: systemd-journal-gatewayd and systemd-journal-remote [installed]
                  libbpf: support BPF programs [installed]
                  libfido2: unlocking LUKS2 volumes with FIDO2 token
                  libp11-kit: support PKCS#11 [installed]
                  tpm2-tss: unlocking LUKS2 volumes with TPM2 [installed]
Required By     : at-spi2-core  base  bluez-hid2hci  bluez-utils  chromium  conmon  cups  cups-filters  dhcpcd  elasticsearch  kismet  libcolord  libgudev  libinput  libpulse  libwacom  lighttpd  mdadm  media-player-info  mitmf
                  mkinitcpio  netctl  polkit  qtwebkit  subversion  systemd-resolvconf  systemd-sysvcompat  torctl  upower  vte3  xorg-xdm
Optional For    : airgeddon  netkit-rwho
Conflicts With  : nss-myhostname  systemd-tools  udev
Replaces        : nss-myhostname  systemd-tools  udev
Installed Size  : 28.28 MiB
Packager        : Christian Hesse <eworm@archlinux.org>
Build Date      : Thu 30 Mar 2023 12:11:55 AM IST
Install Date    : Sun 02 Apr 2023 10:55:36 PM IST
Install Reason  : Installed as a dependency for another package
Install Script  : Yes
Validated By    : Signature

backup file: systemd: /etc/systemd/coredump.conf (Modification time mismatch)
backup file: systemd: /etc/systemd/coredump.conf (Size mismatch)
backup file: systemd: /etc/systemd/coredump.conf (MD5 checksum mismatch)
backup file: systemd: /etc/systemd/coredump.conf (SHA256 checksum mismatch)
backup file: systemd: /etc/systemd/journal-remote.conf (Modification time mismatch)
backup file: systemd: /etc/systemd/journal-remote.conf (Size mismatch)
backup file: systemd: /etc/systemd/journal-remote.conf (MD5 checksum mismatch)
backup file: systemd: /etc/systemd/journal-remote.conf (SHA256 checksum mismatch)
backup file: systemd: /etc/systemd/journald.conf (Modification time mismatch)
backup file: systemd: /etc/systemd/logind.conf (Modification time mismatch)
backup file: systemd: /etc/systemd/logind.conf (Size mismatch)
backup file: systemd: /etc/systemd/logind.conf (MD5 checksum mismatch)
backup file: systemd: /etc/systemd/logind.conf (SHA256 checksum mismatch)
backup file: systemd: /etc/systemd/resolved.conf (Modification time mismatch)
backup file: systemd: /etc/systemd/resolved.conf (Size mismatch)
backup file: systemd: /etc/systemd/resolved.conf (MD5 checksum mismatch)
backup file: systemd: /etc/systemd/resolved.conf (SHA256 checksum mismatch)
backup file: systemd: /etc/systemd/system.conf (Modification time mismatch)
backup file: systemd: /etc/systemd/system.conf (Size mismatch)
backup file: systemd: /etc/systemd/system.conf (MD5 checksum mismatch)
backup file: systemd: /etc/systemd/system.conf (SHA256 checksum mismatch)
backup file: systemd: /etc/systemd/timesyncd.conf (Modification time mismatch)
backup file: systemd: /etc/systemd/timesyncd.conf (Size mismatch)
backup file: systemd: /etc/systemd/timesyncd.conf (MD5 checksum mismatch)
backup file: systemd: /etc/systemd/timesyncd.conf (SHA256 checksum mismatch)
backup file: systemd: /etc/systemd/user.conf (Modification time mismatch)
backup file: systemd: /etc/systemd/user.conf (Size mismatch)
backup file: systemd: /etc/systemd/user.conf (MD5 checksum mismatch)
backup file: systemd: /etc/systemd/user.conf (SHA256 checksum mismatch)
backup file: systemd: /etc/udev/udev.conf (Modification time mismatch)
backup file: systemd: /etc/udev/udev.conf (Size mismatch)
backup file: systemd: /etc/udev/udev.conf (MD5 checksum mismatch)
backup file: systemd: /etc/udev/udev.conf (SHA256 checksum mismatch)
warning: systemd: /var/log/journal (GID mismatch)
systemd: 1330 total files, 1 altered file

mkinitcpio.conf contains only:

HOOKS=(base udev autodetect modconf block keymap encrypt filesystems keyboard fsck consolefont)
Earlier it has nvidia modules (nvida nvidia_uvm ...) after getting error unload it.

I did mkinitcpio -P for creating new image and after rebooting this happens. "Kernel panic {unable to find /init}"

Last edited by ranurag (2023-07-22 13:54:13)

Offline

#7 2023-07-22 14:05:13

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,501

Re: kernel failed to execute /init. Not booting.

not a dynamic executable

stat /bin/init
file /bin/init

Offline

#8 2023-07-22 14:09:14

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

># stat /bin/init

  File: /bin/init -> ../lib/systemd/systemd
  Size: 22              Blocks: 0          IO Block: 4096   symbolic link
Device: 254,0   Inode: 5636538     Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-07-21 22:30:58.720212312 +0530
Modify: 2023-07-21 02:03:54.000000000 +0530
Change: 2023-07-21 22:25:40.929924869 +0530
 Birth: 2023-07-21 22:25:40.929924869 +0530

># file /bin/init

/bin/init: symbolic link to ../lib/systemd/systemd

Offline

#9 2023-07-22 14:10:56

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,501

Re: kernel failed to execute /init. Not booting.

So that's fine.

stat /lib/systemd/systemd
file /lib/systemd/systemd

Offline

#10 2023-07-22 14:15:08

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

># stat lib/systemd/systemd

 File: /usr/lib/systemd/systemd
  Size: 88176           Blocks: 176        IO Block: 4096   regular file
Device: 254,0   Inode: 6190328     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-07-21 20:18:28.334867348 +0530
Modify: 2023-03-30 00:11:55.000000000 +0530
Change: 2023-07-04 12:48:27.815307839 +0530
 Birth: 2023-07-04 12:48:27.815307839 +0530

># file /usr/lib/systemd/systemd

/usr/lib/systemd/systemd: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=c9c4121a7937fd9df375572a970ca3d19bea222b, for GNU/Linux 4.4.0, stripped

Offline

#11 2023-07-22 15:28:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,501

Re: kernel failed to execute /init. Not booting.

So "not a dynamic executable" was a red herring? Typo? Unresolved symlink? Maybe chroot issue.

To be sure:

ldd /lib/systemd/systemd
ldd /usr/lib/systemd/systemd

When re-creating the initramfs, did you maybe forget to mount the /boot partition?
Is the output in this thread so far w/ a mounted /boot partition?

Do you get to unlock your partition before this error?

Please post an older system journal from the chroot, https://wiki.archlinux.org/title/System … al_to_view
You can use the tip from teh first link below to upload it to a pastebin service.

Offline

#12 2023-07-22 16:50:26

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

The error is at very start journal is not enable at that instance. So my last journal is just before my last commit to image.
># ldd usr/lib/systemd/systemd

not a dynamic executable

Offline

#13 2023-07-22 17:06:40

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

1. If it is so can you refer/guide some steps to resolve it.
2. The drives are mounted before and after the image creation. So after committing mkinitcpio -P or with -p do i need to mount because i am already in and using the partitions.

How can i know what changes are done which cause this error ?

Offline

#14 2023-07-22 18:08:23

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,003

Re: kernel failed to execute /init. Not booting.

# /dev/mapper/r00t
UUID=43df82b8-a079-4378-b253-0a40a263129a       /               ext4            rw,noatime      0 1

Is your root encrypted ? what is the actual commandline you use in your bootloader ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#15 2023-07-22 18:54:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,501

Re: kernel failed to execute /init. Not booting.

ranurag wrote:

The error is at very start journal is not enable at that instance. So my last journal is just before my last commit to image.
># ldd usr/lib/systemd/systemd

not a dynamic executable

Wtf?
Does "file" still report

/usr/lib/systemd/systemd: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=c9c4121a7937fd9df375572a970ca3d19bea222b, for GNU/Linux 4.4.0, stripped

?

Upload the file

cat /usr/lib/systemd/systemd | curl -F 'file=@-' 0x0.st

Offline

#16 2023-07-23 05:52:32

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

Lone_Wolf wrote:
# /dev/mapper/r00t
UUID=43df82b8-a079-4378-b253-0a40a263129a       /               ext4            rw,noatime      0 1

Is your root encrypted ? what is the actual commandline you use in your bootloader ?

Thank you Lone_Wolf for the reply.

Yes my rootfs is encrypted. I sent these  results by arh-chroot via live usb.

 ># less /etc/fstab 

Is the cmd which I used there.

Last edited by ranurag (2023-07-23 05:59:38)

Offline

#17 2023-07-23 05:58:25

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

seth wrote:

Upload the file

cat /usr/lib/systemd/systemd | curl -F 'file=@-' 0x0.st

># cat /usr/lib/systemd/systemd | curl -F 'file=@-' 0x0.st

 Segmentation fault 

Offline

#18 2023-07-23 06:30:56

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,501

Re: kernel failed to execute /init. Not booting.

Do not chroot into the system, mount it to /mnt and from the iso run

sudo LC_ALL=C pacman --sysroot /tmp -Qkk | grep -v ', 0 altered files' | curl -F 'file=@-' 0x0.st

Offline

#19 2023-07-23 06:53:06

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

seth wrote:
sudo LC_ALL=C pacman --sysroot /tmp -Qkk | grep -v ', 0 altered files' | curl -F 'file=@-' 0x0.st

Result:

 
error: config file /etc/pacman.conf could not be read: No such file or directory

Offline

#20 2023-07-23 07:03:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,501

Re: kernel failed to execute /init. Not booting.

Sorry, I should probably not post before the methyltheobromine insertion…

sudo LC_ALL=C pacman --sysroot /mnt -Qkk | grep -v ', 0 altered files' | curl -F 'file=@-' 0x0.st

Offline

#21 2023-07-23 07:06:51

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

It's okay. I will wait { I have to haha}.

Offline

#22 2023-07-23 07:19:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,501

Re: kernel failed to execute /init. Not booting.

The command in #20 is correct.
If it takes too long and the curl connection gets closed, redirect the output into a file instead and curl that.

There might be a problem w/ glibc and/or the linker (ie. it's not so much init that's corrupt/missing but it's just the first indicator for a wider problem)

Offline

#23 2023-07-23 12:11:22

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

seth wrote:

The command in #20 is correct.
If it takes too long and the curl connection gets closed, redirect the output into a file instead and curl that.

># sudo LC_ALL=C pacman --sysroot /mnt -Qkk | grep  ', 0 altered files' >  touch.txt
># less touch.txt | wc -l

6443

># curl -F 'file=@touch.txt'

http://0x0.st/He25.txt

{sorry for the idle response}

Last edited by ranurag (2023-07-23 12:13:35)

Offline

#24 2023-07-23 13:03:12

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,501

Re: kernel failed to execute /init. Not booting.

"grep -v", you grepped the wrong lines

Offline

#25 2023-07-23 15:22:01

ranurag
Member
Registered: 2023-07-21
Posts: 59

Re: kernel failed to execute /init. Not booting.

stdout and stderr of it.

http://0x0.st/He2d.txt

Offline

Board footer

Powered by FluxBB