LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-16-2012, 10:38 PM   #1
rameshoty
LQ Newbie
 
Registered: Dec 2010
Posts: 8

Rep: Reputation: 0
slackware 14.0, chroot: failed to run command ‘/bin/bash’: No such file or directory


Hi,


1. I have installed slackware14.0 (64bit) in my local machine.

2. I have created the 10 gb image space in slackware machine using below command.
(dd if=/dev/zero of=slack14.img bs=1M count=10075).

3. I have format the image (slack14.img). andmount the slack14.img in /mnt/slack1464. Also I have mount the slackware14.0 ISO image in /mnt/slackwae14_cd.

4. I have installed the custom package through ruby script. The custom package for
installed without any error.

After that While login the mounting image (/mnt/slack1464).

root@slack1464bit:~# chroot /mnt/slack1464
chroot: failed to run command ‘/bin/bash’: No such file or directory
root@slack1464bit:~#

earlier I have created the .img image in (slackware13.1 & 13.37) I am able to
login the without any error.

But I am getting the error in Slackware14.0 64bit only.

Thanks for advance.

BY
DAVID

Last edited by rameshoty; 10-16-2012 at 10:46 PM.
 
Old 10-17-2012, 07:36 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,987
Blog Entries: 54

Rep: Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742
Quote:
Originally Posted by rameshoty View Post
chroot: failed to run command ‘/bin/bash’: No such file or directory
It seems you did not populate your jail area before executing chroot.
 
Old 10-17-2012, 10:06 AM   #3
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-14.1 (3.15.3) UEFI enabled
Posts: 347

Rep: Reputation: 71
Quote:
Originally Posted by unSpawn View Post
It seems you did not populate your jail area before executing chroot.
What is meant as populate the jail.
I am getting the same error after executing:
Code:
# cd /mnt/rescue
# mkdir /mnt/rescue/proc /mnt/rescue/sys /mnt/rescue/dev /mnt/rescue/dev/pts
# mount -t proc proc proc/
# mount -t sysfs sys sys/
# mount -o bind /dev dev/
# mount -t devpts pts dev/pts/
# chroot . /bin/bash
rescue is its own partition with a complete new/fresh slackware64-14.0 installed. I was hoping to use the above sequence to use the 'upgradepkg' command to perform security updates on my rescue partition without rebooting.
What am I missing.
thanks
john
 
Old 10-17-2012, 05:04 PM   #4
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,014

Rep: Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962
There his simply no /bin/bash in /mnt/rescue, that's why you get that error. Just check with "ls /mnt/rescue/bin/bash" This is what unSpwan meant I presume.

Additionally you should use the "-o bind" option for all "mount" commands but AFAIK there is no need to mount devpts.

And there is no need to append /bin/bash to the chroot command anyway as it defaults to /bin/sh which in Slackware is a symlink to /bin/bash.

Last edited by Didier Spaier; 10-17-2012 at 05:05 PM.
 
Old 10-17-2012, 06:39 PM   #5
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-14.1 (3.15.3) UEFI enabled
Posts: 347

Rep: Reputation: 71
Quote:
Originally Posted by Didier Spaier View Post
There his simply no /bin/bash in /mnt/rescue, that's why you get that error. Just check with "ls /mnt/rescue/bin/bash" This is what unSpwan meant I presume.
ls -la /mnt/rescue/bin/bash
-rwxr-xr-x 1 root root 986120 Aug 10 18:09 /mnt/rescue/bin/bash*

Quote:
Additionally you should use the "-o bind" option for all "mount" commands but AFAIK there is no need to mount devpts.
using -o bind for all mounts produces the same error

Quote:
And there is no need to append /bin/bash to the chroot command anyway as it defaults to /bin/sh which in Slackware is a symlink to /bin/bash.
I get the error with or without appending /bin/bash

John
 
Old 10-18-2012, 02:48 AM   #6
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 4,014

Rep: Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962Reputation: 962
@AlleyTrotter: I Have a dual boot Slackware 13.37 + Slackware 14, mounted as /current in Slackware 13.37.

I have no problem doing either "chroot /current" or "cd /current; chroot ." from Slackware 13.37 as root. Furthermore, what do you mean by "the same error". is it the same error as rameshoty's? This could be a different problem anyway so please open your own thread.
 
Old 10-18-2012, 06:26 AM   #7
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-14.1 (3.15.3) UEFI enabled
Posts: 347

Rep: Reputation: 71
Quote:
Originally Posted by Didier Spaier View Post
@AlleyTrotter: I Have a dual boot Slackware 13.37 + Slackware 14, mounted as /current in Slackware 13.37.
I have no problem doing either "chroot /current" or "cd /current; chroot ." from Slackware 13.37 as root. Furthermore, what do you mean by "the same error". is it the same error as rameshoty's? This could be a different problem anyway so please open your own thread.
NO it is not identical to OP. After closer reading my error is "permission denied"
Thank you for your response I will start a new thread.

John

Last edited by AlleyTrotter; 10-18-2012 at 09:24 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
chroot: cannot run command `/bin/bash': Exec format error snakeo2 Linux - Newbie 6 09-28-2010 03:41 AM
chroot: cannot run command `/bin/bash': No such file or directory Toadman Linux - Software 9 03-26-2009 02:36 AM
chroot: cannot run command `/bin/bash': No such file or directory hubabuba Slackware 5 03-23-2008 05:37 PM
chroot: cannot run command `/tools/bin/env': No such file or directory Basel Linux From Scratch 5 06-30-2006 03:00 AM


All times are GMT -5. The time now is 07:15 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration