chroot: cannot run command `/bin/bash': Exec format error
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
chroot: cannot run command `/bin/bash': Exec format error
im in the middle of installing gentoo, and i have followed the handbook step by step, and when it came time to chroot into the box, i got the error listed above. im using the livecd 2006. here is what i've done so far
booted the livecd
mount /dev/sda3 /mnt/gentoo
mount /sda1 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc
mount -o bind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
You need to have the bash binary (or an equivalent shell) available within the new root for use after the chroot to take place. Chances are you forgot to copy it in. Make sure you gets all the libs and such you need. IIRC from the one Gentoo install I ever did, there should be a section in the install docs about setting that up.
thanks for the reply, but i think the problem was that i was using a x86 cd for my 64 box and that was causing problems. I started from scratch again and now im having annother problem. im getting error 17, cant mount selected partition. here is my partition layoug
from i got gather, error 17 refers to the wrong fileysystem for the partition selected, which makes no sense to me since i formated my /boot with ext2 and /root with ext3 so it makes no sense.
my fstab
/dev/sda1 /boot
/dev/sda3 /root
/dev/sda2 /swap
here is my grub.conf
grub.conf
default o
timeout 30
splashimage=(hd0,0)_/boot/grub/splash.xpm.gz
title=gentoo server
root_(hd0,0)
kernel_/kernel-genkernel-x86_64-2.6.16-gentoo-r13
dam grub, ok im still having problems booting gentoo. any grub gurus outthere, please feel free to provide input. i know grub starts counint from (hd0,0) and regardless of whether you have a IDE or SATA, grub sees them as hd, now here is my question, windows xp is on hda and gentoo is on sda, so in the line for grub.conf where i have (hd0,0) shouldnt it be different? my mobo has two IDE slots, in the primary i have my hda where windows resides. on the secondary i have my cdrom as master and my cdrw as slave. my mobo comes with four SATA controlers and my the HDD where gentoo is plugged into SATA controller#1. so can anyone please tell me how would that translate for grub to boot my gentoo. thanks
It depends on how the BIOS configures the drives, most likely PATA/IDE drives will be initialised first, then SATA. In grub, drives are in BIOS order, so sda will (probably) be hd1.
joe, thanks for the tip, that's correct, last night i read a few threads and noticed that my grub.conf file had
root (hd0,0) which in fact would be my hda drive and not my sata drive which is where my gentoo resides. so i booted off the live cd chrooted into and edit my grub to read
(hd1,0) which would be the /boot partition on my sda drive and it worked. of course im still having problems, i tried emerging xorg-x11 and gettting error messages. it's complaining that it cant find a name to that ebuild. i know i read that xorg 7.0 had been added to portage so i dont know if this has anything to do with it. i will keep trying tonight when i get home from work. thanks. any advise please feel free comment.
thanks for the reply, but i think the problem was that i was using a x86 cd for my 64 box and that was causing problems.
Thanks for mentioning that, I was having the same problem using i386 Debian 5 on a x64 machine and creating a new install using "debootstrap --arch amd64 lenny /mnt/ http://ftp.debian.com/debian"
It's obvious now but I didn't think it was because my /bin/bash was i386 but my /mnt/bin/bash was AMD64 stupid me
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.