slackware 14.0, chroot: failed to run command ‘/bin/bash’: No such file or directory
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
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
@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: 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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.