Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
chroot:cannot run command '/bin/bashn : Exec format error
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
iggyman
n00b
n00b


Joined: 25 Dec 2004
Posts: 21

PostPosted: Mon Dec 27, 2004 1:10 am    Post subject: chroot:cannot run command '/bin/bashn : Exec format error Reply with quote

I am new to linux.I reached the chroot part of the install. Irun the command # chroot /mnt/gentoo /bin/bash and I get the error-chroot:cannot run command '/bin/bashn : Exec format error.Can someone help me with this.I checked the help files for /bin/bash and was not much help

Thank You
Back to top
View user's profile Send private message
markfw
n00b
n00b


Joined: 27 Dec 2004
Posts: 30

PostPosted: Mon Dec 27, 2004 2:17 am    Post subject: Reply with quote

I have exactly the same problem and am also new to linux. I am somewhat competent on unix, and during the install following the 98 page instructions, there were directories and files missing that I created, or copied and edited (make.conf was missing, found make.conf.something on the cd and copied over)

Please ,make another convert !! Athlon64 setup, no other special stuff.

and the error BTW was that /bin/bash not found directory or something like that, so like the rest of what I did, I created /mnt/gentoo/bin/bash, and then also copied from the CD all the contents of the cd /bin to the /mnt/gentoo/bin directory. Still same problem.
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2915
Location: Singapore

PostPosted: Mon Dec 27, 2004 2:28 am    Post subject: Reply with quote

markfw wrote:
I have exactly the same problem and am also new to linux. I am somewhat competent on unix, and during the install following the 98 page instructions, there were directories and files missing that I created, or copied and edited (make.conf was missing, found make.conf.something on the cd and copied over)

There is a make.conf.example right in the /mnt/gentoo/etc directory (before you do the chroot). Just copy it over to make.conf and edit as necessary.

markfw wrote:
and the error BTW was that /bin/bash not found directory or something like that, so like the rest of what I did, I created /mnt/gentoo/bin/bash, and then also copied from the CD all the contents of the cd /bin to the /mnt/gentoo/bin directory. Still same problem.

Be more specific about the error, post the exact wording of the message here.

Be sure to mount /mnt/gentoo exactly as in the Handbook.

And i think you've messed up the /mnt/gentoo/bin directory totally by that file copying you did. My advice is to erase the contents of /mnt/gentoo with the command
Code:
cd /mnt/gentoo && rm -rf *
and restart from the step when you copied over a Stage 1/2/3 tarball over to /mnt/gentoo and un-tar'ed it.

Lastly, the command is chroot /mnt/gentoo /bin/bash with a space between /mnt/gentoo and /bin/bash.
Back to top
View user's profile Send private message
markfw
n00b
n00b


Joined: 27 Dec 2004
Posts: 30

PostPosted: Mon Dec 27, 2004 2:35 am    Post subject: Reply with quote

kimchi_sg wrote:
markfw wrote:
I have exactly the same problem and am also new to linux. I am somewhat competent on unix, and during the install following the 98 page instructions, there were directories and files missing that I created, or copied and edited (make.conf was missing, found make.conf.something on the cd and copied over)

There is a make.conf.example right in the /mnt/gentoo/etc directory (before you do the chroot). Just copy it over to make.conf and edit as necessary.


markfw wrote:
and the error BTW was that /bin/bash not found directory or something like that, so like the rest of what I did, I created /mnt/gentoo/bin/bash, and then also copied from the CD all the contents of the cd /bin to the /mnt/gentoo/bin directory. Still same problem.

Be more specific about the error, post the exact wording of the message here.


Be sure to mount /mnt/gentoo exactly as in the Handbook.

And i think you've messed up the /mnt/gentoo/bin directory totally by that file copying you did. My advice is to erase the contents of /mnt/gentoo with the command
Code:
rm -rf /mnt/gentoo
and restart from the step when you copied over a Stage 1/2/3 tarball over to /mnt/gentoo and un-tar'ed it.

Lastly, the command is chroot /mnt/gentoo /bin/bash with a space between /mnt/gentoo and /bin/bash.


OK, there was NO /mnt/gentoo/etc directory, so I created one. Then I found the make.conf.example on the cd, copied it over to the directory I made and edited it to fix the athlon64 specific paramaters.

Right now I am trying to "chroot /mnt/gentoo /bin/bash" per the instructions, and it says "no such file or directory". So thats when I created the /bin/bash directory/ and copied /cdrom/bin/* /mnt/gentoo/bin/* hoping it would help, but still I get the same error.

Yes, thats exactly what I did. And I did mount exactly as in the handbook. And I had the space in ther are above (sorry, typo error)


Last edited by markfw on Mon Dec 27, 2004 2:39 am; edited 1 time in total
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2915
Location: Singapore

PostPosted: Mon Dec 27, 2004 2:39 am    Post subject: Reply with quote

markfw wrote:
Yes, thats exactly what I did. I wish I could do screen prints......
Just note down the error message on paper then re-type it for our "inspection". :-D

Since it is a chroot error, I don't think it will be more than 2 - 3 lines long. You haven't seen emerge error output yet.

(Sorry if I scared you with that last sentence.) :-D
Back to top
View user's profile Send private message
iggyman
n00b
n00b


Joined: 25 Dec 2004
Posts: 21

PostPosted: Mon Dec 27, 2004 2:40 am    Post subject: error Reply with quote

this is the error i receive.chroot:cannot run command '/bin/bash : Exec format error.I redid the entire install 3 times and still get the same error.I copied the information from the mirrors on line .

Last edited by iggyman on Mon Dec 27, 2004 2:47 am; edited 1 time in total
Back to top
View user's profile Send private message
markfw
n00b
n00b


Joined: 27 Dec 2004
Posts: 30

PostPosted: Mon Dec 27, 2004 2:44 am    Post subject: Reply with quote

Yes, I re-did mine twice. The first time I was trying a dual boot, and until I understood what the commands were, I messed my 2000 install. So the next time I started with an empty disk. I did the stage1, and I was sucsessful on the mirrorselect part also.

but mine does not say /bin/bashn just /bin/bash

Also, I think the other directories that were missing were /proc /etc /usr and possibly one more. If you want me to do the whole thing again (remove partitions and all) and stop when I get to the first missing directory, let me know. (what another hours work) But I really think something is messed up in the 98 page install. I printed out the whole thing !
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2915
Location: Singapore

PostPosted: Mon Dec 27, 2004 2:54 am    Post subject: Reply with quote

I've just given a quick look at the chroot man page. This error seems to indicate something is wrong with the /bin/bash in the stage tarball.
man chroot wrote:
CHROOT

Section: User Commands (1)

NAME

chroot - run command or interactive shell with special root directory

SYNOPSIS

chroot NEWROOT [COMMAND...]
chroot OPTION

DESCRIPTION

Run COMMAND with root directory set to NEWROOT.

My suggestions is to:
1. Wipe the /mnt/gentoo directory clean with the command
Code:
cd /mnt/gentoo && rm -rf *

2. Download a stage 1/2/3 tarball from a local Gentoo mirror site.
Code:
links -driver fb www.gentoo.org/main/en/mirrors.xml
From the above website, select a mirror site, then download the desired stage tarball.
3. Untar the file and retry the chroot command.

Or if you've no network access, (hopefully this is not the case!) try doing simply
Code:
chroot /mnt/gentoo
without the /bin/bash part. Though I am 90% sure that this "workaround" will fail. :-(
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2915
Location: Singapore

PostPosted: Mon Dec 27, 2004 2:58 am    Post subject: Reply with quote

markfw wrote:
Also, I think the other directories that were missing were /proc /etc /usr and possibly one more. If you want me to do the whole thing again (remove partitions and all) and stop when I get to the first missing directory, let me know. (what another hours work) But I really think something is messed up in the 98 page install. I printed out the whole thing !

The directories under /mnt/gentoo are the only ones that really matter. They are supposed to be created by the stage tarball that you expanded with the command
Code:
tar xvjpf [STAGE FILE NAME].tar.bz2
. Do not try to create any of them yourself, to avoid confusion.

And no, there's no need to restart the whole install. I understand the pain having done this at least 6-7 times myself. Just the steps from copying stage tarball into /mnt/gentoo, onwards.

EDIT: As I said 1 post ago, I suggest you boycott the stage tarball on the CD on retrieve one from the Internet. Or at least retry with a different stage tarball.
Back to top
View user's profile Send private message
markfw
n00b
n00b


Joined: 27 Dec 2004
Posts: 30

PostPosted: Mon Dec 27, 2004 3:04 am    Post subject: Reply with quote

kimchi_sg wrote:
markfw wrote:
Also, I think the other directories that were missing were /proc /etc /usr and possibly one more. If you want me to do the whole thing again (remove partitions and all) and stop when I get to the first missing directory, let me know. (what another hours work) But I really think something is messed up in the 98 page install. I printed out the whole thing !

The directories under /mnt/gentoo are the only ones that really matter. They are supposed to be created by the stage tarball that you expanded with the command
Code:
tar xvjpf [STAGE FILE NAME].tar.bz2
. Do not try to create any of them yourself, to avoid confusion.

And no, there's no need to restart the whole install. I understand the pain having done this at least 6-7 times myself. Just the steps from copying stage tarball into /mnt/gentoo, onwards.

EDIT: As I said 1 post ago, I suggest you boycott the stage tarball on the CD on retrieve one from the Internet. Or at least retry with a different stage tarball.


OK, so you are saying that the whole problem stems from a bad tarball possibly ? Thats a lot of downloading, but I could live with that. After a reboot, what do I have to "mount" and "delete" before I start the tarball download ? 5.b on page29 is the re-start point ? And do I have to do the re-enable dma thing ?

And BTW, thanks for the help.
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2915
Location: Singapore

PostPosted: Mon Dec 27, 2004 3:09 am    Post subject: Reply with quote

markfw wrote:
OK, so you are saying that the whole problem stems from a bad tarball possibly ? Thats a lot of downloading, but I could live with that. After a reboot, what do I have to "mount" and "delete" before I start the tarball download ? 5.b on page29 is the re-start point ? And do I have to do the re-enable dma thing ?

And BTW, thanks for the help.

No, don't reboot, you will end up erasing what you've done up to step 5b.

If you've rebooted, you will have to re-enable DMA, etc, etc. :-(

In short, don't reboot, just go to /mnt/gentoo directory and clear everything there with the single command cd /mnt/gentoo && rm -rf *

Then proceed to step 5b of the Handbook.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


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

PostPosted: Mon Dec 27, 2004 3:35 am    Post subject: Re: error Reply with quote

iggyman wrote:
chroot:cannot run command '/bin/bash : Exec format error.

You will get this error if you boot with a 32bit kernel and try to install a 64bit stage tarball (or vice-versa).


EDIT : Take a look at this thread Problems Chrooting


Last edited by cyrillic on Mon Dec 27, 2004 3:38 am; edited 1 time in total
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2915
Location: Singapore

PostPosted: Mon Dec 27, 2004 3:37 am    Post subject: Reply with quote

I was / am assuming that these guys know their processors and can choose the stage tarball correctly. :roll: Oh well, if all else fails go with a stage 1 tarball install for x86 and do a stage 1 bootstrap. :-D

EDIT: Even there i'm assuming a 32-bit x86 architecture. Darn.
Back to top
View user's profile Send private message
shash
Apprentice
Apprentice


Joined: 18 Apr 2003
Posts: 220
Location: India

PostPosted: Mon Dec 27, 2004 4:11 am    Post subject: Reply with quote

What stage tarball did you use? Try the AMD64 stage 1?
Back to top
View user's profile Send private message
markfw
n00b
n00b


Joined: 27 Dec 2004
Posts: 30

PostPosted: Mon Dec 27, 2004 4:18 am    Post subject: Reply with quote

shash wrote:
What stage tarball did you use? Try the AMD64 stage 1?


Yes, I know my processor, and its an Athlon64 3200+ newcastle on a ECS 755-A2 motherboard. I used the universal CD(that I downloaded) and the stage1 tarball. I will delete, enable dma, and go forward again, including downloading a new tarball.
Back to top
View user's profile Send private message
iggyman
n00b
n00b


Joined: 25 Dec 2004
Posts: 21

PostPosted: Mon Dec 27, 2004 4:30 am    Post subject: Thank You Reply with quote

You wer right.i forgot.I checked the cd and it only had the x86 tar1.I tried using the amd64 tar1 anf that is what caused it.Thank You guys for your help and quick responces
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2915
Location: Singapore

PostPosted: Mon Dec 27, 2004 5:13 am    Post subject: Re: Thank You Reply with quote

iggyman wrote:
You wer right.i forgot.I checked the cd and it only had the x86 tar1.I tried using the amd64 tar1 anf that is what caused it.Thank You guys for your help and quick responces

@iggyman: Please put [SOLVED] into the thread title if everything's really OK.
Back to top
View user's profile Send private message
iggyman
n00b
n00b


Joined: 25 Dec 2004
Posts: 21

PostPosted: Mon Dec 27, 2004 5:35 am    Post subject: Solved Reply with quote

Solved-Thank You all
Back to top
View user's profile Send private message
markfw
n00b
n00b


Joined: 27 Dec 2004
Posts: 30

PostPosted: Mon Dec 27, 2004 5:42 am    Post subject: Reply with quote

Well, I still have a problem. I re-did everything, and re-downloaded the stage file, and now I have "could not extract patch" during the bootstrap.sh run. It has been 10 minutes, and no more messages. Now what ? Is it dead ? do I r-boot ?
Back to top
View user's profile Send private message
iggyman
n00b
n00b


Joined: 25 Dec 2004
Posts: 21

PostPosted: Mon Dec 27, 2004 6:01 am    Post subject: does take a while Reply with quote

I started my bootstrap an hour ago and it does hang up on some of the servers but eventually does get past it.if you reached the boot strap part,then find something to keep busy.it does take a while
Back to top
View user's profile Send private message
markfw
n00b
n00b


Joined: 27 Dec 2004
Posts: 30

PostPosted: Mon Dec 27, 2004 6:06 am    Post subject: Re: does take a while Reply with quote

iggyman wrote:
I started my bootstrap an hour ago and it does hang up on some of the servers but eventually does get past it.if you reached the boot strap part,then find something to keep busy.it does take a while

OK, so how long do I be patient ? 1,2,3 hours ? 30 minutes ??

Remember Athlon64 3200+.....

And thanks again for any replies...
Back to top
View user's profile Send private message
iggyman
n00b
n00b


Joined: 25 Dec 2004
Posts: 21

PostPosted: Mon Dec 27, 2004 6:10 am    Post subject: no eta Reply with quote

I have some of the connection time out and keeps retrying.i have no eta till the bootstrap is complete.sorry
Back to top
View user's profile Send private message
markfw
n00b
n00b


Joined: 27 Dec 2004
Posts: 30

PostPosted: Mon Dec 27, 2004 6:41 am    Post subject: Reply with quote

I did the bootstrap -f first. That is done. So Do I re-boot and try to remount drives and try again, or wait more? One hour and still no messages after the error.....
Back to top
View user's profile Send private message
kimchi_sg
Advocate
Advocate


Joined: 26 Nov 2004
Posts: 2915
Location: Singapore

PostPosted: Mon Dec 27, 2004 7:19 am    Post subject: Reply with quote

Try removing the GENTOO_MIRRORS line in your make.conf, if you used mirrorselect. Then restart bootstrap / emerge. Seems that lots of people have mirrorselect giving them slow / broken mirrors.
Back to top
View user's profile Send private message
markfw
n00b
n00b


Joined: 27 Dec 2004
Posts: 30

PostPosted: Mon Dec 27, 2004 5:23 pm    Post subject: Reply with quote

kimchi_sg wrote:
Try removing the GENTOO_MIRRORS line in your make.conf, if you used mirrorselect. Then restart bootstrap / emerge. Seems that lots of people have mirrorselect giving them slow / broken mirrors.


Did you see my reply ? Should I start a new thread ? I need to restart the bootstrap. Do I need to re-do the dma and remount ? then just bootstrap/emerge ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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