FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 05-29-2008, 09:13 AM
Peter Humphrey
 
Default chroot problem

I have no problem chrooting into a system on the hard disk if I've booted
from an installation CD, but every time I try it after booting from another
HD partition I get e.g. this:

# chroot /mnt/rescue /bin/bash
chroot: cannot run command `/bin/bash': Permission denied

Ls shows the same permissions in each case, and I always make sure to:

# cd /mnt/rescue
# mount -tproc proc proc
# mount -obind /dev dev

...first.

What am I doing wrong?

--
Rgds
Peter
--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-29-2008, 09:21 AM
Justin
 
Default chroot problem

Peter Humphrey schrieb:
I have no problem chrooting into a system on the hard disk if I've booted
from an installation CD, but every time I try it after booting from another
HD partition I get e.g. this:


# chroot /mnt/rescue /bin/bash
chroot: cannot run command `/bin/bash': Permission denied

Ls shows the same permissions in each case, and I always make sure to:

# cd /mnt/rescue
# mount -tproc proc proc
# mount -obind /dev dev

...first.

What am I doing wrong?




# cd /mnt/rescue
# mount -t proc proc proc
# mount -o bind /dev dev


You forgot some spaces!
 
Old 05-29-2008, 09:25 AM
Dirk Heinrichs
 
Default chroot problem

Am Donnerstag, 29. Mai 2008 schrieb ext Justin:

> > # cd /mnt/rescue
> > # mount -tproc proc proc
> > # mount -obind /dev dev
> >
> > ...first.
> >
> > What am I doing wrong?
>
> # cd /mnt/rescue
> # mount -t proc proc proc
> # mount -o bind /dev dev
>
>
> You forgot some spaces!

They're irrelevant.

Bye...

Dirk
--
Dirk Heinrichs | Tel: +49 (0)162 234 3408
Configuration Manager | Fax: +49 (0)211 47068 111
Capgemini Deutschland | Mail: dirk.heinrichs@capgemini.com
Wanheimerstraße 68 | Web: http://www.capgemini.com
D-40468 Düsseldorf | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: wwwkeys.pgp.net
 
Old 05-29-2008, 09:28 AM
Dirk Heinrichs
 
Default chroot problem

Am Donnerstag, 29. Mai 2008 schrieb ext Peter Humphrey:
> I have no problem chrooting into a system on the hard disk if I've booted
> from an installation CD, but every time I try it after booting from
> another HD partition I get e.g. this:
>
> # chroot /mnt/rescue /bin/bash
> chroot: cannot run command `/bin/bash': Permission denied
>
> Ls shows the same permissions in each case, and I always make sure to:
>
> # cd /mnt/rescue
> # mount -tproc proc proc
> # mount -obind /dev dev
>
> ...first.
>
> What am I doing wrong?

Just a wild guess: /mnt/rescue mounted with noexec?

Bye...

Dirk
--
Dirk Heinrichs | Tel: +49 (0)162 234 3408
Configuration Manager | Fax: +49 (0)211 47068 111
Capgemini Deutschland | Mail: dirk.heinrichs@capgemini.com
Wanheimerstraße 68 | Web: http://www.capgemini.com
D-40468 Düsseldorf | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: wwwkeys.pgp.net
 
Old 05-29-2008, 09:29 AM
Justin
 
Default chroot problem

Dirk Heinrichs schrieb:

Am Donnerstag, 29. Mai 2008 schrieb ext Justin:



# cd /mnt/rescue
# mount -tproc proc proc
# mount -obind /dev dev

...first.

What am I doing wrong?


# cd /mnt/rescue
# mount -t proc proc proc
# mount -o bind /dev dev


You forgot some spaces!



They're irrelevant.

Bye...

Dirk


Really? I didn't know that, thanks!
 
Old 05-29-2008, 09:38 AM
Wolf Canis
 
Default chroot problem

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter Humphrey wrote:
> I have no problem chrooting into a system on the hard disk if I've booted
> from an installation CD, but every time I try it after booting from another
> HD partition I get e.g. this:
>
> # chroot /mnt/rescue /bin/bash
> chroot: cannot run command `/bin/bash': Permission denied
>
> Ls shows the same permissions in each case, and I always make sure to:
>
> # cd /mnt/rescue
> # mount -tproc proc proc
> # mount -obind /dev dev
>
> ...first.
>
> What am I doing wrong?
>
Only for verification, have you under /mnt/rescue /bin/bash?
Or with other words have this /mnt/rescue/bin/bash?
And with the appropriate permissions?

W. Canis

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkg+eZ0ACgkQKT9zBKF0twWTtwCdHIkXGHwaas 50Zy2leKo5g6iU
gP8AnRuiWCgemE/GFja4RaduEfcWp/9g
=hplz
-----END PGP SIGNATURE-----
--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-29-2008, 09:50 AM
 
Default chroot problem

Wolf Canis <wolf.canis@googlemail.com>
29/05/2008 11:38
Por favor, responda a gentoo-user

Para: gentoo-user@lists.gentoo.org
cc:
Asunto: Re: [gentoo-user] chroot problem

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter Humphrey wrote:
> I have no problem chrooting into a system on the hard disk if I've
booted
> from an installation CD, but every time I try it after booting from
another
> HD partition I get e.g. this:
>
> # chroot /mnt/rescue /bin/bash
> chroot: cannot run command `/bin/bash': Permission denied
>
> Ls shows the same permissions in each case, and I always make sure to:
>
> # cd /mnt/rescue
> # mount -tproc proc proc
> # mount -obind /dev dev
>
> ...first.
>
> What am I doing wrong?
>
Only for verification, have you under /mnt/rescue /bin/bash?
Or with other words have this /mnt/rescue/bin/bash?
And with the appropriate permissions?

W. Canis

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkg+eZ0ACgkQKT9zBKF0twWTtwCdHIkXGHwaas 50Zy2leKo5g6iU
gP8AnRuiWCgemE/GFja4RaduEfcWp/9g
=hplz
-----END PGP SIGNATURE-----
--
gentoo-user@lists.gentoo.org mailing list
************************************************** ********

Just in case, you'll also need proper permissions for /mnt/rescue/lib and
libraries inside there. Bash dinamically loads libraries, so the user
running it must have execution perms over invoked libraries.

That puzzled me for two weeks till I finally fixed it last saturday :-P

HTH,
Abraham

--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-31-2008, 09:51 AM
Peter Humphrey
 
Default chroot problem

On Thursday 29 May 2008 10:28:40 Dirk Heinrichs wrote:
> Am Donnerstag, 29. Mai 2008 schrieb ext Peter Humphrey:
> > What am I doing wrong?
>
> Just a wild guess: /mnt/rescue mounted with noexec?

No, that isn't it.

--
Rgds
Peter
--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-31-2008, 10:06 AM
Peter Humphrey
 
Default chroot problem

On Thursday 29 May 2008 10:50:59 tecnic5@silvanoc.com wrote:
> Wolf Canis <wolf.canis@googlemail.com>
> > Only for verification, have you under /mnt/rescue /bin/bash?
> > Or with other words have this /mnt/rescue/bin/bash?
> > And with the appropriate permissions?

Yes, I said so the first time.

> > W. Canis
>
> Just in case, you'll also need proper permissions for /mnt/rescue/lib and
> libraries inside there. Bash dinamically loads libraries, so the user
> running it must have execution perms over invoked libraries.
>
> That puzzled me for two weeks till I finally fixed it last saturday :-P

No, that isn't it either. I'm doing everything as root, as one would when
installing or repairing the system. I never have got chrooting working as
an ordinary user.

I installed both the rescue system and the main system from the current
installation CD, whichever that was - 2007.1, I think. In each case, I
continued the installation to build the system I wanted: KDE on the main
system and only a few tools on the rescue system. I didn't mess about with
essential system components like bash.

Is it possible that chrooting from one bash version to another is my
problem? I think they're the same, and it'll take me some time to check.

Or maybe the problem is in the chroot function in the system I'm leaving.

--
Rgds
Peter
--
gentoo-user@lists.gentoo.org mailing list
 
Old 05-31-2008, 10:40 AM
Wolf Canis
 
Default chroot problem

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter Humphrey wrote:
[...]
> # cd /mnt/rescue
> # mount -tproc proc proc
> # mount -obind /dev dev

I mean that the mount commands should be:

# mount -tproc proc /mnt/rescue/proc
# mount -obind /dev /mnt/rescue/dev

I just build a mini chroot environment. My working
directory is /root.
I create under /root a directory x. The contents under x
is:

# ls -R
x:
bin dev lib proc

x/bin:
bash

x/dev:

x/lib:
ld-linux.so.2 libc.so.6 libdl.so.2 libncurses.so.5

x/proc:

Then my mount commands:

# mount -tproc proc x/proc
# mount -obind /dev x/dev

Then chroot:

# chroot /root/x /bin/bash
wolf-di6400 0(0) 10:38 AM / #


Hope that helps.

W. Canis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhBKyMACgkQKT9zBKF0twWttgCffzjUSQZAxN BZcAwf9avjvZYa
YDoAn1Rw5y18equ4b+27hAhCnboyfF0x
=Um4X
-----END PGP SIGNATURE-----
--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 11:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org