Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
chroot gives /bin/bash not found error message
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
increa
n00b
n00b


Joined: 09 Oct 2006
Posts: 2

PostPosted: Mon Oct 09, 2006 4:55 pm    Post subject: chroot gives /bin/bash not found error message Reply with quote

I'm going through the X86 Quick Install document. Things work well until I tried to chroot to the new /mnt/gentoo root. At that point /bin/bash is id'ed as unavailable, and so is /bin/sh. I even tried explicity specifying the cdrom location. Same result. Both shell executables run fine when used alone on the command line. Why is the chroot command not finding them? Console dump:

livecd / # uname -a
Linux livecd 2.6.17-gentoo-r7 #1 SMP Mon Sep 18 01:26:27 UTC 2006 i686 AMD Athlon(tm) Processor GNU/Linux
livecd / # chroot /mnt/gentoo /bin/bash
chroot: cannot run command `/bin/bash': No such file or directory
livecd / # ls -l /bin
lrwxrwxrwx 1 root root 15 Oct 9 07:41 /bin -> /mnt/livecd/bin
livecd / # chroot /mnt/gentoo /mnt/livecd/bin/bash
chroot: cannot run command `/mnt/livecd/bin/bash': No such file or directory
livecd / # ls /mnt/livecd/bin/ba*
/mnt/livecd/bin/basename /mnt/livecd/bin/bash /mnt/livecd/bin/bashlogin

A similar posting titled, "Cannot CHROOT into native install" covers this same basic issue, but that poster had the problem solved by properly mounting partitions. I think mine are:

livecd ~ # mount
tmpfs on / type tmpfs (rw)
/dev/hdc on /mnt/cdrom type iso9660 (ro)
/dev/loop0 on /mnt/livecd type squashfs (ro)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
udev on /dev type tmpfs (rw,nosuid)
devpts on /dev/pts type devpts (rw)
cachedir on /mnt/livecd/lib/splash/cache type tmpfs (rw)
tmpfs on /mnt/livecd/lib/firmware type tmpfs (rw)
tmpfs on /mnt/livecd/usr/portage type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=85)
/dev/hda2 on /mnt/gentoo type ext3 (rw)
/dev/hda4 on /mnt/gentoo/home type ext3 (rw)
proc on /mnt/gentoo/proc type proc (rw)
livecd ~ #

Any help surely appreciated. This seems like such a trivial issue compared to everything else I see posted, but I'm stuck!
Back to top
View user's profile Send private message
rokstar83
Guru
Guru


Joined: 09 Apr 2005
Posts: 423
Location: MD

PostPosted: Mon Oct 09, 2006 5:46 pm    Post subject: Reply with quote

I could be wrong however the target /bin/bash should be in /mnt/gentoo/bin/bash not on the cdrom. Check to make sure the /bin/bash is in your /mnt/gentoo other wise you make have to re-untar the stagefile to make sure its gets up in the right place.
Back to top
View user's profile Send private message
increa
n00b
n00b


Joined: 09 Oct 2006
Posts: 2

PostPosted: Mon Oct 09, 2006 8:50 pm    Post subject: Reply with quote

My /mnt/gentoo/bin directory is empty. The stagefile was downloaded into the /mnt/gentoo/usr directory and untarred there, per the X86 Quick Install document, giving a /mnt/gentoo/usr/portage directory with lots of files in it.

Can you clarify, "otherwise you may have to re-untar the stagefile to make sure it gets set up in the right place" ? Where is the right place?

Just to try, I manually copied the bash executable over to /mnt/gentoo/bin. The chroot command gives the same error. It would be good to know, given the "chroot new-root start-command" syntax, does the start-command execute in the new context of the new-root? If so, I have to agree there should be a bash file under the /mnt/gentoo tree. How would it have gotten there if the Install Guide says untar it under the /mnt/gentoo/usr directory?
Back to top
View user's profile Send private message
rokstar83
Guru
Guru


Joined: 09 Apr 2005
Posts: 423
Location: MD

PostPosted: Mon Oct 09, 2006 9:11 pm    Post subject: Reply with quote

I think you skipped a step.

tar -xjpvf x86-stage3.tar.bz2 -C /mnt/gentoo

To get the base files into your future root directory. Then you untar you portage tree snap shot.
I would recommend that you use the full gentoo handbook and not the quick install. My impression is that the quick install is for folks who have done the installation a lot of times and just need the steps to remind them what to do and the right order.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Tue Oct 10, 2006 12:24 am    Post subject: Reply with quote

increa wrote:
Just to try, I manually copied the bash executable over to /mnt/gentoo/bin. The chroot command gives the same error.

The reason that this didn't work is because bash uses shared libraries, and you would need to copy them over too.

... but I agree with rokstar83, it looks like you skipped some steps along the way.
Back to top
View user's profile Send private message
davascript
l33t
l33t


Joined: 07 Apr 2004
Posts: 618
Location: Pennsylvania

PostPosted: Wed Oct 11, 2006 2:00 pm    Post subject: Reply with quote

Quote:
The stagefile was downloaded into the /mnt/gentoo/usr

Both the stage tarball and the portage snapshot should be downloaded to /mnt/gentoo as per the manual not /mnt/gentoo/usr.
Back to top
View user's profile Send private message
neysx
Retired Dev
Retired Dev


Joined: 27 Jan 2003
Posts: 795

PostPosted: Wed Oct 11, 2006 3:23 pm    Post subject: Reply with quote

Gentoo Linux x86 Quick Install Guide wrote:
Users should already have prior experience with installing Gentoo Linux if they want to follow this guide.
Gentoo Linux x86 Quick Install Guide also wrote:
Next, download a stage from one of our mirrors. Go to /mnt/gentoo and unpack the stage using tar xjpf <stage3 tarball>
I guess you missed this step in http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml#doc_chap2_sect7. See rokstar83's reply above, but make sure you use the i686 stage3 as documented, not the x86 one.

Hth
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum