Help! /bin/bash not found on chroot
Volker Wysk
post at volker-wysk.de
Wed Dec 1 13:39:24 UTC 2021
Am Mittwoch, dem 01.12.2021 um 13:01 +0000 schrieb Colin Watson:
> On Sat, Nov 27, 2021 at 04:47:27PM +0100, Volker Wysk wrote:
> > Something happened to my system. Suddenly, next to nothing worked any
> > more. For instance "ls" won't be found any longer.
> >
> > I made a reboot and the system asks for the disk password, and
> > afterwards dies. When going into the recovery, then there are messages
> > stating that /sbin/init and /etc/init aren't found. Then the system
> > stops with a kernel panic.
> >
> > I'm trying to fix the problem by booting from an USB stick. Then I
> > mount the faulty system at /mnt/rootneu and do this:
> >
> > mount BOOTPART /mnt/rootneu/boot
> > mount EFIPART /mnt/rootneu/boot/efi
> > mount --rbind /dev /mnt/rootneu/dev
> > mount --rbind /proc /mnt/rootneu/proc
> > mount --rbind /sys /mnt/rootneu/sys
> >
> > I do this so I can "update-initramfs -u", "grub-install ..." and
> > "update-grub" later.
> >
> > So far, it works. But then I try to chroot to the system that fails
> > with:
> >
> > chroot /mnt/rootneu
> >
> > This FAILS with:
> >
> > chroot: failed to run command '/bin/bash': No such file or directory
> >
> > Even though /bin/bash and /mnt/rootneu/bin/bash are both present and
> > can be started.
>
> In general, when you see this sort of problem, it's because one of the
> other files needed by that executable is broken.
Great! :-( Such a misleading error message.
> Running a program usually requires opening more than one file. For
> example, on a 64-bit x86 system, /bin/bash requires first the dynamic
> linker (/lib64/ld-linux-x86-64.so.2), followed by a number of libraries
> it's linked against: /lib/x86_64-linux-gnu/libc.so.6,
> /lib/x86_64-linux-gnu/libdl.so.2, and
> /lib/x86_64-linux-gnu/libtinfo.so.6. ("ldd /bin/bash" lists these,
> along with "linux-vdso.so.1" which is a magic thing provided by the
> kernel.) If any of these is broken, then you'll get the error above.
I see.
> Unfortunately the program execution interface generally squashes these
> so that it isn't possible to report exactly which one went wrong, though
> in some cases you can work it out using tools such as strace; so I don't
> know exactly what your problem is, but maybe that will provide some kind
> of clue.
The problem is no longer. I've already recovered by replacing the root file
system (excluding my home directory) with the version in a backup. This has
fixed the problem. (At least so it seems). See the other messages in this
thread.
Thanks for your answer!
Bye, Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20211201/d3fcbe9b/attachment.sig>
More information about the ubuntu-users
mailing list