-   Linux - Newbie (
-   -   chroot: cannot run command `/bin/bash': Exec format error (

snakeo2 07-14-2006 05:52 PM

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


btmiller 07-16-2006 03:05 AM

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.

snakeo2 07-17-2006 08:05 AM

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

/hda windows
/sda ( gentoo)
sda1 /boot
sda2 /swap
sda3 /root
sda4 /extended
sda5 /home

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

default o
timeout 30
title=gentoo server


title=windows xp

im at work right now so i cant access my box, if you need anything let me know and i'll post when i get home. thanks

snakeo2 07-18-2006 08:05 AM

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

ioerror 07-18-2006 03:46 PM

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.

snakeo2 07-19-2006 06:53 AM

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.

FireRaven 09-28-2010 03:41 AM


Originally Posted by snakeo2 (Post 2337711)
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/"
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 :)

All times are GMT -5. The time now is 12:00 PM.