You are not logged in.

#1 2020-12-12 04:33:36

KingX
Member
From: CA
Registered: 2010-03-24
Posts: 324

[SOLVED] Unable to chroot into existing installation, /bin/bash error

Hello,

I am a little stumped as my existing Arch Linux install keeps getting stuck at "Reached Graphical Target" and doesn't proceed further. I cannot change to another tty to login either, get a blank screen. In my infinite wisdom I had also set the timeout for grub to 0 seconds, so I am also unable to boot into runlevel 3 and prevent auto-login into xfce4.

I wanted to chroot into my existing install and do a pacman -Syu and also add a timeout to grub. But when I try to chroot I get an error "Cannot execute /bin/bash: exec format error".

Searching around the only thing I see mentioned is that architecture mixup between 32bit/64bit can cause this. But I am booting from the latest archlinux-2020.12.01-x86_64 iso and my install is also 64bit.

Any help or pointers appreciated.

Last edited by KingX (2020-12-12 23:05:06)

Offline

#2 2020-12-12 04:46:48

twobooks
Member
From: rainforest
Registered: 2020-06-23
Posts: 47

Re: [SOLVED] Unable to chroot into existing installation, /bin/bash error

rather than chroot, you can mount your questionable system to modify auto-login,
or mount the boot partition to change grub boot stuff.

Offline

#3 2020-12-12 04:49:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,513
Website

Re: [SOLVED] Unable to chroot into existing installation, /bin/bash error

You do not need to chroot to make changes.  Just mount the filesystems and do what you need to do.

But if you want to troubleshoot to the chroot error, post the complete chroot command used, and the output of the following:

uname -a
file /mnt/bin/bash

I suspect there's also a way to still access the grub command line via holding down a key / key combination during boot up.  Every other boot loader I know of has such an option, but I've never used GRUB(2).

Last edited by Trilby (2020-12-12 04:50:42)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2020-12-12 09:24:19

GSMiller
Member
Registered: 2020-11-23
Posts: 75

Re: [SOLVED] Unable to chroot into existing installation, /bin/bash error

KingX, is chroot the best solution? You have to look at all its output to determine that. You can also show us the complete output.


A dog is a man's best friend.

Offline

#5 2020-12-12 19:23:03

KingX
Member
From: CA
Registered: 2010-03-24
Posts: 324

Re: [SOLVED] Unable to chroot into existing installation, /bin/bash error

Not sure if chroot is best. But I just found out there is no /bin/bash on my system.

# file /mnt/bin/bash
/mnt/bin/bash: empty

Last packages that were updated when I ran Syu.

systemd-libs (247.1-1 -> 2.47.1-3)
libva-mesa-driver (20.3.0-2 -> 20.3.0-3)
mesa (20.3.0-2 -> 20.3.0-3)
mesa-vdpau (20.3.0-2 -> 20.3.0-3)
sbc (1.4-2 -> 1.5-1)
systemd (247.1-1 -> 247.1-3)
systemd-sysvcompat (247.1-1 -> 247.1-3)
vulkan-mesa-layers (20.3.0-2 -> 20.3.0-3)
vulkan-radeon (20.3.0-2 -> 20.3.0-3)
linux (5.9.12.arch1-1 -> 5.9.13.arch1-1)

I looked through /mnt/bin to see what others files are empty (0 size) and other than bash, sudo, visudo is also at 0.

How do I restore bash onto my system?

Offline

#6 2020-12-12 19:30:53

loqs
Member
Registered: 2014-03-06
Posts: 19,029

Re: [SOLVED] Unable to chroot into existing installation, /bin/bash error

Offline

#7 2020-12-12 23:02:48

KingX
Member
From: CA
Registered: 2010-03-24
Posts: 324

Re: [SOLVED] Unable to chroot into existing installation, /bin/bash error

Thank you for the wiki link. That helped me get my system back. A lot of things got messed up including archlinux-keyring. I manually downloaded bash and extracted it. This allowed me to chroot and then I reinstalled the pacman keys and updated the system. smile

Offline

Board footer

Powered by FluxBB