View previous topic :: View next topic |
Author |
Message |
peje Tux's lil' helper
Joined: 11 Jan 2003 Posts: 100
|
Posted: Sun Apr 05, 2009 7:11 pm Post subject: cant chroot on lvm2 on raid; system is running... |
|
|
I can't chroot on amd64, lvm2 raid, all needed stuff is in the directory I want to chroot but always:
chroot: cannot run command `/bin/bash': No such file or directory
running gentoo 2.6.29
any Ideas
thanks cu Peje |
|
Back to top |
|
|
honp Guru
Joined: 25 Sep 2006 Posts: 355 Location: Good old Prague, Czech rep.
|
Posted: Mon Apr 06, 2009 3:02 pm Post subject: |
|
|
maybe you don`t have bash installed. Try /bin/sh. |
|
Back to top |
|
|
cyrillic Watchman
Joined: 19 Feb 2003 Posts: 7313 Location: Groton, Massachusetts USA
|
Posted: Mon Apr 06, 2009 3:28 pm Post subject: Re: cant chroot on lvm2 on raid; system is running... |
|
|
peje wrote: | chroot: cannot run command `/bin/bash': No such file or directory |
If you get this message when the file /bin/bash actually exists in the chroot directory, then it could be a shared library and/or linking problem.
You can see what libraries are needed for an executable using the "ldd" command.
Code: | # ldd /bin/bash
linux-gate.so.1 => (0xb7fa3000)
libncurses.so.5 => /lib/libncurses.so.5 (0xb7f4a000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f46000)
libc.so.6 => /lib/libc.so.6 (0xb7dfa000)
/lib/ld-linux.so.2 (0xb7fa4000) |
|
|
Back to top |
|
|
peje Tux's lil' helper
Joined: 11 Jan 2003 Posts: 100
|
Posted: Thu Apr 09, 2009 8:04 pm Post subject: |
|
|
thank you for the hints, yes /bin/bash is in the chroot, but I dont understand the output of ldd, I want to chroot from 64 to 32 bit.
Code: |
pejeserver / # ldd /bin/bash
linux-vdso.so.1 => (0x00007fff4d9ff000)
libncurses.so.5 => /lib/libncurses.so.5 (0x00007fcc454a2000)
libdl.so.2 => /lib/libdl.so.2 (0x00007fcc4529e000)
libc.so.6 => /lib/libc.so.6 (0x00007fcc44f56000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcc45703000)
pejeserver / # ldd /chroot1/bin/bash
linux-vdso.so.1 => (0x00007fffb99ff000)
libncurses.so.5 => /lib/libncurses.so.5 (0x00007f04b13e0000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f04b11dc000)
libc.so.6 => /lib/libc.so.6 (0x00007f04b0e94000)
/lib64/ld-linux-x86-64.so.2 (0x00007f04b1641000)
linux32 chroot /chroot1 /bin/bash
chroot: cannot run command `/bin/bash': No such file or directory
pejeserver / # ls -al /chroot1/bin/bash
-rwxr-xr-x 1 root root 796696 4. Apr 12:46 /chroot1/bin/bash
So what is going wrong? I thougt an chroot inot 32 bit shouldn't be that hard
thanks, cu Peje |
|
|
Back to top |
|
|
cyrillic Watchman
Joined: 19 Feb 2003 Posts: 7313 Location: Groton, Massachusetts USA
|
Posted: Thu Apr 09, 2009 10:07 pm Post subject: |
|
|
Another thing to check is if the binaries in the chroot are 32bit or if they are 64bit, because the 32bit chroot will only work if the contents are also 32bit.
You should see something like this when you check the libraries outside and inside the chroot.
Code: | # file /lib/libncurses.so.5.7
/lib/libncurses.so.5.7: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
# file /chroot1/lib/libncurses.so.5.7
/chroot1/lib/libncurses.so.5.7: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped |
|
|
Back to top |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Thu Apr 09, 2009 10:39 pm Post subject: |
|
|
Are you using a hardened kernel? One option in grsecurity or pax is to dissallow chrooting. |
|
Back to top |
|
|
|