Re: [gentoo-user] chroot problem
On Sunday 01 June 2008 20:10:22 Neil Bothwick wrote: On Sun, 1 Jun 2008 18:51:02 +0100, Peter Humphrey wrote: * Is there a way to find out what USE flags a package has been compiled with when it's not the current system but a rescue system mounted temporarily in it? Anyone? Look in var/db/pkg/cate-gory/pkgname-version/USE Thanks Neil. -- Rgds Peter -- gentoo-user@lists.gentoo.org mailing list
Re: [gentoo-user] chroot problem
2008/5/29 Peter Humphrey [EMAIL PROTECTED]: 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 Are you using SELinux or anything similar? If so (or you aren't sure), what do the following commands (as root) say: id -Z ls -alZR /mnt/rescue If not then try strace'ing the chroot call, like so: strace -etrace=chroot,chdir,execve chroot /mnt/rescue /bin/bash That will show whether it is the chroot call itself that is failing or the attempt to run bash afterwards. Cheers, Duane. -- I never could learn to drink that blood and call it wine - Bob Dylan -- gentoo-user@lists.gentoo.org mailing list
Re: [gentoo-user] chroot problem
On Saturday 31 May 2008 21:09:52 Alexander Meinke wrote: However, I think this problem is [neither] mount nor bash related. Try # mount -tproc proc /mnt/rescue/proc # mount -obind /dev /mnt/rescue/dev # chroot /mnt/rescue /bin/bash That's almost exactly what I did. To be certain, I tried it with the full paths you suggest, but of course I got the same result. Especially check the permissions of /mnt/rescue/bin/bash and /bin/bash. They should be at least 0755. As I said the first time, the permissions are the same on both, thus: # ls -l bin/bash -rwxr-xr-x 1 root root 772120 2008-05-29 17:29 bin/bash # ls -l /mnt/rescue/bin/bash -rwxr-xr-x 1 root root 772120 2008-05-29 17:29 /mnt/rescue/bin/bash As they're the same size, I assume they're the same version - but they could have been compiled with different USE flags. I'll look into that. [Later: on remerging bash in the main system the flags look perfectly innocent, and I can't imagine having set them differently on the rescue system; but I will look next time I boot the rescue system*.] ... rebuild the package that include 'chroot' so that right permissions are set for the program and its libs. The permissions are right already, but I'll do that anyway. I hope this helps in any way and excuse me for that bad English. I've no difficulty following you :-) Thanks also to the others who've helped. Wolf's idea wouldn't help me because I want a separate system that will boot even if the main one won't. It's on a different physical disk as well. * Is there a way to find out what USE flags a package has been compiled with when it's not the current system but a rescue system mounted temporarily in it? Anyone? -- Rgds Peter -- gentoo-user@lists.gentoo.org mailing list
Re: [gentoo-user] chroot problem
On Sun, 1 Jun 2008 18:51:02 +0100, Peter Humphrey wrote: * Is there a way to find out what USE flags a package has been compiled with when it's not the current system but a rescue system mounted temporarily in it? Anyone? Look in var/db/pkg/cate-gory/pkgname-version/USE -- Neil Bothwick Does the name Pavlov ring a bell? signature.asc Description: PGP signature
Re: [gentoo-user] chroot problem
On Thursday 29 May 2008 10:50:59 [EMAIL PROTECTED] wrote: Wolf Canis [EMAIL PROTECTED] 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
Re: [gentoo-user] 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
Re: [gentoo-user] 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 iEYEARECAAYFAkhBKyMACgkQKT9zBKF0twWttgCffzjUSQZAxNBZcAwf9avjvZYa YDoAn1Rw5y18equ4b+27hAhCnboyfF0x =Um4X -END PGP SIGNATURE- -- gentoo-user@lists.gentoo.org mailing list
Re: [gentoo-user] chroot problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wolf Canis wrote: 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 Ooops, I overlooked your cd command. Therefore the mount command is of course correct. :-[ W. Canis -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhBSZgACgkQKT9zBKF0twXnmgCeKd9BcrcinpSFZYlYHH6JkYmJ TAUAnjVNmHArsqLbx3nclUPDhIZqQzbW =nt4b -END PGP SIGNATURE- -- gentoo-user@lists.gentoo.org mailing list
Re: [gentoo-user] chroot problem
Wolf Canis wrote: # mount -tproc proc /mnt/rescue/proc # mount -obind /dev /mnt/rescue/dev Ooops, I overlooked your cd command. Therefore the mount command is of course correct. :-[ Hi, I think this is, although the 'cd' command is executed, necessary as the mount command looks at /etc/fstab and if e.g. 'proc' is specified at command line mount uses information from fstab. However, I think this problem is whether mount nor bash related. Try # mount -tproc proc /mnt/rescue/proc # mount -obind /dev /mnt/rescue/dev # chroot /mnt/rescue /bin/bash Especially check the permissions of /mnt/rescue/bin/bash and /bin/bash. They should be at least 0755. In case of there are several permission problems last time on my system ('up-to-date-system', no ~*) rebuild the package that include 'chroot' so that right permissions are set for the program and its libs. I hope this helps in any way and excuse me for that bad English. Regards, acm. signature.asc Description: OpenPGP digital signature
Re: [gentoo-user] 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! signature.asc Description: OpenPGP digital signature
Re: [gentoo-user] 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: [EMAIL PROTECTED] Wanheimerstraße 68 | Web: http://www.capgemini.com D-40468 Düsseldorf | ICQ#: 110037733 GPG Public Key C2E467BB | Keyserver: wwwkeys.pgp.net signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] 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! signature.asc Description: OpenPGP digital signature
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+eZ0ACgkQKT9zBKF0twWTtwCdHIkXGHwaas50Zy2leKo5g6iU gP8AnRuiWCgemE/GFja4RaduEfcWp/9g =hplz -END PGP SIGNATURE- -- gentoo-user@lists.gentoo.org mailing list
Re: [gentoo-user] chroot problem
Wolf Canis [EMAIL PROTECTED] 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+eZ0ACgkQKT9zBKF0twWTtwCdHIkXGHwaas50Zy2leKo5g6iU 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
Re: [gentoo-user] 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: [EMAIL PROTECTED] Wanheimerstraße 68 | Web: http://www.capgemini.com D-40468 Düsseldorf | ICQ#: 110037733 GPG Public Key C2E467BB | Keyserver: wwwkeys.pgp.net signature.asc Description: This is a digitally signed message part.