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

2013-03-07 Thread Rodrigo Rivas
On Thu, Mar 7, 2013 at 4:02 AM, Sean Greenslade zootboys...@gmail.comwrote:

 On Wed, Mar 6, 2013 at 8:32 PM, David C. Rankin
 drankina...@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.


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

2013-03-07 Thread David C. Rankin
On 03/06/2013 08:24 PM, Ross Hamblin wrote:
 It's been a while now but ISTR this message when chroot from 32 bit host
 and 64 bit target, or maybe it was vice versa.
 
 HTH
 Ross.

  It does. It has to be something that simple. However, checking, I have booted
with the i686 install medium. The box is an older dell P4, so the i686 is
correct and matches the system installed. The install disk /bin/bash date is May
7, 2011. The /bin/bash on /dev/sda6 at /mnt/usr/bin/bash (after mount of the
system / at /mnt) is January 26, 2013. Attempting the chroot again on fresh
reboot gives the same failure:

# cd /mnt
# chroot /mnt
chroot: failed to run command `/bin/bash`: No such file or directory

  For some reason it is like the system has no ability to find anything. The
install cd is a pre /lib change cd, so that may be the issue. I have downloaded
the latest install cd and will try again.

Thank you again Ross.

Any other suggestions welcomed.

-- 
David C. Rankin, J.D.,P.E.


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

2013-03-07 Thread Rodrigo Rivas
On Thu, Mar 7, 2013 at 10:30 PM, David C. Rankin 
drankina...@suddenlinkmail.com wrote:

 On 03/06/2013 08:24 PM, Ross Hamblin wrote:
 # cd /mnt
 # chroot /mnt
 chroot: failed to run command `/bin/bash`: No such file or directory

   For some reason it is like the system has no ability to find anything.
 The
 install cd is a pre /lib change cd, so that may be the issue. I have
 downloaded
 the latest install cd and will try again.

 Thank you again Ross.

 Any other suggestions welcomed.


Well, that error usually happens, at least to me, when the dynamic loader
is unable to solve the shared dependencies of bash, hence the suggestion to
use busybox: it is statically linked, so it doesn't suffer of that problem.

In my machine the dynamic loader is `/usr/lib/ld-linux.so.2` but the
reference to it is `/lib/ld-linux.so.2`. It works because of the `/lib` -
`usr/lib` symbolic link. I'd bet that the cause of your problem is that
this link is missing. If

If the symbolic link in /lib is correct, it also may happen because the
`/etc/ld.so.cache` file is corrupted. You can rebuild it using `chroot /mnt
/usr/bin/ldconfig` or maybe `ldconfig -r /mnt` (untested). That can work
because `ldconfig` is (obviously) a statically linked program.

HTH
Rodrigo


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

2013-03-06 Thread Sean Greenslade
On Wed, Mar 6, 2013 at 8:32 PM, David C. Rankin
drankina...@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.

-- 
--Zootboy

Sent from some sort of computing device.