[Closed] Kernel Panic -> manjaro-chroot -a -> Exec format error

Problem

I cannot run manjaro-chroot -a when I rescue my Manjaro System.

Environment

  • Dual boot (Windows 10, Manjaro Linux Budgie desktop)
  • NVIDIA GTX 1080
  • Intel i7-9700
  • (C-drive contains Windows, E-drive contains Manjaro)

Background

I faced on freezing when I update sudo pacman -Syu my Manjaro. Reluctantly, I restart my PC.

And I found Manjaro is running failed with the message Bad RIP value.

So I try this official(?) tutorial Tutorial: How to magically fix most computers that will not boot after a manjaro update! .

I run manjaro-chroot -a, But I saw below message

[manjaro@manjaro-budgie ~]$ manjaro-chroot -a
==> Mounting (ManjaroLinux) [dev/sda3]
 --> mount: [/mnt]
 --> mount: [/mnt/boot/efi]
chroot: failed to run command '/bin/bash' : Exec format error
 --> umount : [/mnt/boot/efi]
 --> umount : [/mnt]

I try uname -m, it reply x86_64. And also, my PC is x86_64

Please Any Help. Thanks!

Do you run manjaro-chroot -a from a live USB?

The error Exec format error usually means that the binary being executed is made for a different architecture than the environment currently booted. It usually occurs when the system has been booted on a 32-bit system when a 64-bit environment is trying to load. So, could it be that you used a 32-bit LiveCD on a 64-bit install or otherway around?

1 Like

Yes.
My Manjaro is never running because raising errors.
So I run those commands with live USB.

I try this ISO (https://ja.osdn.net/projects/manjaro-community/storage/budgie/18.1.0/
=> [manjaro-budgie-18.1.0-stable-x86_64.iso])

My PC is x86_64 (I confirmed by Windows 10 (it's another OS which is contained in My PC))

Did you check whether the .sha value is correct or the .sig is correct? Could be a broken download.

Thanks, I checked!

sha256sum manjaro...x86_64.iso
is same as
cat manjaro...x86_64.iso.sha256

(and also, sha1sum is same)

1 Like

Is the manjaro-chroot command trying to call /bin/bash from the live USB drive or from the drive where Manjaro is installed? If it is the latter, could it be that bash executable is corrupted on the drive where Manjaro is installed, not on the live USB?

1 Like

I would need to check, but usually @artoo 's coding is too advanced for me...

1 Like

I don't know the internal process of manjaro-chroot -a but I can try this example.

[manjaro@manjaro-budgie ~]$ sudo mkdir /mnt/arch
[...] $ sudo mount /dev/sda3 /mnt/arch
[...] $ sudo ls /mnt/arch/bin/bash
/mnt/arch/bin/bash
[...] $ manjaro-chroot /mnt/arch ### chroot to /mnt/arch = /dev/sda3 which is My Manjaro
chroot: failed to run command '/bin/bash' :  Exec format error

※Now, I closed mounting by sudo umount /mnt/arch and sudo rm -r /mnt/arch

1 Like

That's what I wanted to ask.
And if that fails, then try to chroot "manually", by mounting all internal folders like here:
https://wiki.manjaro.org/index.php?title=Restore_the_GRUB_Bootloader#Manually_Identify_and_Prepare_the_Installed_Partition.28s.29

1 Like

OK, now I try these processes.

(Any Process is finished, write below... If you notice anything, please reply...)

[...]$ sudo mount /dev/sda3 /mnt/arch
[...]$ ls /mnt/arch/boot
efi grub initramfs-4.19-x86_64-fallback.img initramfs-4.19-x86_64.img intel-ucode.img linux419-x86_64.kver memtest86+ vmlinuz-4.19-x86_64
[...]$ cd /mnt/arch
[...]$ sudo mount -t proc proc /mnt/arch/proc
[...]$ sudo mount -t sysfs sys /mnt/arch/sys
[...]$ sudo mount -o bind /dev /mnt/arch/dev
[...]$ sudo mount -t devpts pts /mnt/arch/dev/pts
[...]$ sudo chroot /mnt
chroot: failed to run command '/bin/bash': Exec format error

Eventually the same error occurred....

Can you copy the bash binary from the live USB to the /bin directory on the drive where Manjaro is installed? Perhaps back up the old one first...

1 Like

But more might be broken on the installed system than /bin/bash, I would ultimately reinstall (or recover from a snapshot) instead of using a half-repaired system.

2 Likes

Indeed. But my hope is that he could at least chroot successfully...

1 Like

First, I remove all mount And

[...] $ sudo mount /dev/sda3 /mnt/arch
[...] $ sudo mv /mnt/arch/bin/bash /home/manjaro/ ### for backup
[...] $ sudo cp /bin/bash /mnt/arch/bin/
[...] $ ls /mnt/arch/bin/bash
/mnt/arch/bin/bash
[...] $ manjaro-chroot /mnt/arch
chroot: failed to run command '/bin/sh' : Input/output error

copy the whole /bin folder
sudo cp -a /bin /mnt/arch

Nevermind, derp.

1 Like
[...] $ sudo mv  /mnt/arch/bin /home/manjaro
[...] $ sudo cp -a /bin /mnt/arch
[...] $ ls /mnt/arch/bin
<many files>
[...] $ manjaro-chroot /mnt/arch
chroot: failed to run command '/bin/sh': Input/output error
[...] $ ls /mnt/arch | grep sh
...
sfv-hash
sh
sha1sum
...

Forum kindly sponsored by