Author Topic: [SOLVED] chroot: failed to run command `/bin/bash': No such file or directory  (Read 6350 times)

Offline ternor

  • Hero Member
  • *****
  • Posts: 1793
Hello.  I mounted a live cd as follows:

Code: [Select]
# mount /dev/sr0 /mnt/loop -t iso9660 -o loop
I then tried to chroot to the live cd using various syntaxes which all returned the error message shown in the title:

Code: [Select]
# chroot loop
chroot: failed to run command `/bin/bash': No such file or directory
# chroot ./loop
chroot: failed to run command `/bin/bash': No such file or directory
# which bash
/bin/bash
# chroot /mnt/loop
chroot: failed to run command `/bin/bash': No such file or directory

I would appreciate any advice.  A simple mount command results in the live cd being mounted 'read-only'.
« Last Edit: September 14, 2012, 04:17:21 PM by ternor »

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11546
  • ----IOFLU----
Re: chroot: failed to run command `/bin/bash': No such file or directory
« Reply #1 on: September 13, 2012, 07:02:33 PM »
Hello.  I mounted a live cd as follows:

Code: [Select]
# mount /dev/sr0 /mnt/loop -t iso9660 -o loop
I then tried to chroot to the live cd using various syntaxes which all returned the error message shown in the title:

Code: [Select]
# chroot loop
chroot: failed to run command `/bin/bash': No such file or directory
# chroot ./loop
chroot: failed to run command `/bin/bash': No such file or directory
# which bash
/bin/bash
# chroot /mnt/loop
chroot: failed to run command `/bin/bash': No such file or directory

I would appreciate any advice.  A simple mount command results in the live cd being mounted 'read-only'.

You loop mount an ISO image, not a CD, and a burned liveCD is always mounted "read only". When is the last time you were able to write to a CD?  ???
« Last Edit: September 13, 2012, 07:07:44 PM by Old-Polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline dougmack

  • Hero Member
  • *****
  • Posts: 965
Re: chroot: failed to run command `/bin/bash': No such file or directory
« Reply #2 on: September 13, 2012, 07:03:21 PM »
This may be stating the obvious, but a live CD can not be written to, so I'm hardly surprised to see it mount read-only. Am I missing something?

--doug
Blessed are the peacemakers...for they shall be shot at from both sides.  A. M. Greeley

Offline ternor

  • Hero Member
  • *****
  • Posts: 1793
Re: chroot: failed to run command `/bin/bash': No such file or directory
« Reply #3 on: September 13, 2012, 07:10:00 PM »
Yes, of course.  Using the simple mount command I can still not chroot to the live cd.  I want to run some commands in that environment.  Is it possible?

Code: [Select]
# umount /dev/sr0
# mount /dev/sr0 /mnt/loop
mount: block device /dev/sr0 is write-protected, mounting read-only
# chroot /mnt/loop
chroot: failed to run command `/bin/bash': No such file or directory

Offline JALU

  • Sr. Member
  • ****
  • Posts: 455
  • Just Another Linux User
Re: chroot: failed to run command `/bin/bash': No such file or directory
« Reply #4 on: September 14, 2012, 03:21:22 AM »
Yes, of course.  Using the simple mount command I can still not chroot to the live cd.  I want to run some commands in that environment.  Is it possible?

Umm... ternor,  you might try booting from the live CD ?
Cages
« Last Edit: September 14, 2012, 03:49:27 AM by darkages »
THEN and THAN usage..
Use than to make a comparison. Use then when referring to time.

Offline TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 723
Re: chroot: failed to run command `/bin/bash': No such file or directory
« Reply #5 on: September 14, 2012, 03:41:04 AM »
You can't chroot to a liveCD in the way you are trying to do.
It does not contain a "root filesystem" that is immediately available (which is why bash cannot be found).  It is contained in a livecd.sqfs file which is unpacked into RAM at boot time to provide a root filesystem.

Terry.  
« Last Edit: September 14, 2012, 03:45:36 AM by TerryN »
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|

Offline ternor

  • Hero Member
  • *****
  • Posts: 1793
Re: chroot: failed to run command `/bin/bash': No such file or directory
« Reply #6 on: September 14, 2012, 03:49:15 AM »
Thanks TerryN.  I may try unpacking that file.  The reason I want to run it from my OS, darkages, is that I need recourse to applications available on the OS and not on the cd.

Offline JALU

  • Sr. Member
  • ****
  • Posts: 455
  • Just Another Linux User
Re: chroot: failed to run command `/bin/bash': No such file or directory
« Reply #7 on: September 14, 2012, 03:52:02 AM »
What I meant was boot from the Live CD and chroot to your HDD partition when required...
Cages.
THEN and THAN usage..
Use than to make a comparison. Use then when referring to time.

Offline TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 723
Re: chroot: failed to run command `/bin/bash': No such file or directory
« Reply #8 on: September 14, 2012, 04:00:52 AM »
Thanks TerryN.  I may try unpacking that file.  The reason I want to run it from my OS, darkages, is that I need recourse to applications available on the OS and not on the cd.

Then surely you should be booting from the LiveCD and chroot'ing to the installed environment  ;)

EDIT:  as darkages has said

Terry
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|

Offline ternor

  • Hero Member
  • *****
  • Posts: 1793
Re: chroot: failed to run command `/bin/bash': No such file or directory
« Reply #9 on: September 14, 2012, 03:46:19 PM »
Thanks for the replies.  I'll try that.