LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   slackware 14.0, chroot: failed to run command ‘/bin/bash’: No such file or directory (http://www.linuxquestions.org/questions/slackware-14/slackware-14-0-chroot-failed-to-run-command-%91-bin-bash%92-no-such-file-or-directory-4175432674/)

rameshoty 10-16-2012 10:38 PM

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

unSpawn 10-17-2012 07:36 AM

Quote:

Originally Posted by rameshoty (Post 4807774)
chroot: failed to run command ‘/bin/bash’: No such file or directory

It seems you did not populate your jail area before executing chroot.

AlleyTrotter 10-17-2012 10:06 AM

Quote:

Originally Posted by unSpawn (Post 4808101)
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

Didier Spaier 10-17-2012 05:04 PM

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.

AlleyTrotter 10-17-2012 06:39 PM

Quote:

Originally Posted by Didier Spaier (Post 4808526)
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

Didier Spaier 10-18-2012 02:48 AM

@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.

AlleyTrotter 10-18-2012 06:26 AM

Quote:

Originally Posted by Didier Spaier (Post 4808850)
@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


All times are GMT -5. The time now is 04:11 PM.