[arch-general] Cannot chroot '/bin/bash': No such file or directory

Rodrigo Rivas rodrigorivascosta at gmail.com
Thu Mar 7 15:05:52 EST 2013


On Thu, Mar 7, 2013 at 4:02 AM, Sean Greenslade <zootboysean at gmail.com>wrote:

> On Wed, Mar 6, 2013 at 8:32 PM, David C. Rankin
> <drankinatty at suddenlinkmail.com> wrote:
> > Guys,
> >
> >   Attempting to fix the test box that updating left unable to boot, I
> cannot
> > chroot to fix the system. I've booted from the install medium and done
> the
> > normal mount of the existing system under /mnt:
> >
> > mount /dev/sda6 /mnt
> > mount /dev/sda5 /mnt/home
> > mount /dev/sda8 /mnt/boot
> > mount -o bind /dev /mnt/dev
> > mount -t proc none /mnt/proc
> > mount -t sysfs none /mnt/sys
> >
> >   All files appear in their proper place under /mnt. However, attempting
> to
> > create the chroot fails:
> >
> > cd /mnt
> > chroot /mnt /bin/bash
> >
> > chroot: failed to run command '/bin/bash': No such file or directory
> >
> >   /bin/bash is in the new location /usr/bin/bash (moved from /bin/bash
> by the
> > update) with with a proper symlink in /mnt/bin/bash pointing to
> ../usr/bin/bash
> >
> >   This if the first time I've ever had difficulty chrooting a system. I
> suspect
> > that this is caused by the last update that pulled in systemd which left
> the
> > system unbootable. Anyone know what could be causing the chroot failure?
> I've
> > tried explicitly pointing the chroot to ./usr/bin/bash, etc... and tried
> it
> > without any executable specified. Regardless, I get the same "No such
> file or
> > directory".
> >
> >   Thanks in advance for any help or link you can provide.
> >
> > --
> > David C. Rankin, J.D.,P.E.
>
> I had this issue once. It was on a system that had corruption on its
> root drive due to power failures. The error can be very misleading; in
> my case the file existed and yet the chroot still failed. I ended up
> wiping that system, but the most likely conclusion I could come to was
> that some very important system .so's got corrupted. If you have
> busybox installed, try chrooting into busybox's sh. If that works and
> the bash executable really does exist despite that error, I'm afraid
> you may have a quite the thrashed system on your hands.
>

And if you don't have busybox installed, you can copy the `busybox` binary
to, say, /mnt/tmp and then `chroot mnt /tmp/busybox`.

Rodrigo.


More information about the arch-general mailing list