LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
Search this Thread
Old 07-14-2006, 05:52 PM   #1
snakeo2
Member
 
Registered: Mar 2004
Location: Miami, Fl
Distribution: Red Hat 9/fedora core3/
Posts: 273

Rep: Reputation: 30
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

thanks
 
Old 07-16-2006, 03:05 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,107

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
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.
 
Old 07-17-2006, 08:05 AM   #3
snakeo2
Member
 
Registered: Mar 2004
Location: Miami, Fl
Distribution: Red Hat 9/fedora core3/
Posts: 273

Original Poster
Rep: Reputation: 30
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

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

initrd_/boot/initramfs-kernel-genkernel-x86_64-2.6.16-gentoo-r13

title=windows xp
root_(hd0,1)
makeactive
chainloader_+1


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
 
Old 07-18-2006, 08:05 AM   #4
snakeo2
Member
 
Registered: Mar 2004
Location: Miami, Fl
Distribution: Red Hat 9/fedora core3/
Posts: 273

Original Poster
Rep: Reputation: 30
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
 
Old 07-18-2006, 03:46 PM   #5
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
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.
 
Old 07-19-2006, 06:53 AM   #6
snakeo2
Member
 
Registered: Mar 2004
Location: Miami, Fl
Distribution: Red Hat 9/fedora core3/
Posts: 273

Original Poster
Rep: Reputation: 30
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.
 
Old 09-28-2010, 03:41 AM   #7
FireRaven
Member
 
Registered: Apr 2006
Location: Australia
Distribution: Debian Squeeze
Posts: 135

Rep: Reputation: 18
Quote:
Originally Posted by snakeo2 View Post
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
 
  


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
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
chroot: cannot run command `/tools/bin/env': No such file or directory Basel Linux From Scratch 5 06-30-2006 03:00 AM
Bash Scripting and Chroot/Exec yoshiznit123 Linux - General 5 12-14-2005 08:20 PM
exec bash command bendeco13 Linux - General 6 10-31-2004 03:50 PM
linux command error message bash: /usr/bin/find: No such file or directory sundaram123 Linux - General 8 04-02-2002 07:18 AM


All times are GMT -5. The time now is 02:31 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