Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cant chroot on lvm2 on raid; system is running...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
peje
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jan 2003
Posts: 100

PostPosted: Sun Apr 05, 2009 7:11 pm    Post subject: cant chroot on lvm2 on raid; system is running... Reply with quote

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
View user's profile Send private message
honp
Guru
Guru


Joined: 25 Sep 2006
Posts: 355
Location: Good old Prague, Czech rep.

PostPosted: Mon Apr 06, 2009 3:02 pm    Post subject: Reply with quote

maybe you don`t have bash installed. Try /bin/sh.
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 Apr 06, 2009 3:28 pm    Post subject: Re: cant chroot on lvm2 on raid; system is running... Reply with quote

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
View user's profile Send private message
peje
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jan 2003
Posts: 100

PostPosted: Thu Apr 09, 2009 8:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
cyrillic
Watchman
Watchman


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

PostPosted: Thu Apr 09, 2009 10:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Thu Apr 09, 2009 10:39 pm    Post subject: Reply with quote

Are you using a hardened kernel? One option in grsecurity or pax is to dissallow chrooting.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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