LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-23-2006, 02:28 PM   #1
mikedeatworld
Member
 
Registered: Nov 2003
Location: Farmington Michigan
Distribution: UBUNTU - Slackware - SuSE 9.1 - Knoppix - Fedora
Posts: 828

Rep: Reputation: 30
Unable to chroot


I created a directoy /mnt/knx/master/KNOPPIX

And I what to setup a "jail" like environment, and use chroot. When I run chroot I get this error:


ddevbox:/mnt/knx/source# chroot /mnt/knx/source/KNOPPIX
chroot: cannot run command `/bin/bash': No such file or directory

And ideas?
 
Old 10-23-2006, 03:07 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
When you're chrooting an user, the whole environment is needed under that dir - basic tools, libraries etc, because chroot makes the normal ones unaccessible. What do you have in the dir you're chrooting to?
 
Old 10-23-2006, 03:16 PM   #3
mikedeatworld
Member
 
Registered: Nov 2003
Location: Farmington Michigan
Distribution: UBUNTU - Slackware - SuSE 9.1 - Knoppix - Fedora
Posts: 828

Original Poster
Rep: Reputation: 30
I've copied all files from a KNOPPIX CD that a tutorial called for.

I'm on Section 14.

http://www.knoppix.net/wiki/Knoppix_Remastering_Howto

I am using the following wiki @ http://www.knoppix.net/wiki/Knoppix_...or_Remastering

To remaster Knoppix v. 5.0.1

I have setup a Debian Sarge host system where I will do most of the remastering. This system is stable and running fine.

I have followed the instructions without incident up until the point, where I get an error in Section 14.

"# Now you can "chroot" into the copied KNOPPIX"
miked@ddevbox:/mnt/knx/source/KNOPPIX$ is my path

When I run chroot, I get this error:

ddevbox:/mnt/knx/source# chroot /mnt/knx/source/KNOPPIX
chroot: cannot run command `/bin/bash': No such file or directory

To troubleshoot, I followed
http://poornam.com/articles_troubleshooting.php

I have tried to see if my libraries were setup correctly:

Code:
ddevbox:/home# ldd /bin/bash
        libncurses.so.5 => /lib/libncurses.so.5 (0x4002a000)
        libdl.so.2 => /lib/libdl.so.2 (0x4006b000)
        libc.so.6 => /lib/libc.so.6 (0x4006f000)
        /lib/ld-linux.so.2 (0x40000000)
ddevbox:/home#

ddevbox:/# ldd bin/bash
        libncurses.so.5 => /lib/libncurses.so.5 (0x4002a000)
        libdl.so.2 => /lib/libdl.so.2 (0x4006b000)
        libc.so.6 => /lib/libc.so.6 (0x4006f000)
        /lib/ld-linux.so.2 (0x40000000)
ddevbox:/# ls -l lib/libncurses.so.5
lrwxrwxrwx 1 root root 17 Oct 13 09:08 lib/libncurses.so.5 -> libncurses.so.5.5
ddevbox:/# ls -l lib/libdl.so.2
lrwxrwxrwx 1 root root 14 Oct 13 09:08 lib/libdl.so.2 -> libdl-2.3.6.so
ddevbox:/# ls -l lib/ld-linux.so.2
lrwxrwxrwx 1 root root 11 Oct 13 09:08 lib/ld-linux.so.2 -> ld-2.3.6.so
ddevbox:/#
And I checked on bash:

Code:
ddevbox:/# ls -l bin/bash /bin/bash
-rwxr-xr-x 1 root root 676384 Jul  5  2006 /bin/bash
-rwxr-xr-x 1 root root 676384 Jul  5  2006 bin/bash
ddevbox:/#
Its there!?!?

I am not, sure where else to look / troubleshoot this issue.


Maybe step 13. Copy everything necessary files except the ~700 Mb KNOPPIX file failed for me???


I need to figure out what I have not setup! Any help would be great.

Last edited by mikedeatworld; 10-23-2006 at 03:20 PM.
 
Old 10-24-2006, 07:33 AM   #4
mikedeatworld
Member
 
Registered: Nov 2003
Location: Farmington Michigan
Distribution: UBUNTU - Slackware - SuSE 9.1 - Knoppix - Fedora
Posts: 828

Original Poster
Rep: Reputation: 30
any ideas? i've google'd this to death...

SO, MARA, to answer your question, I should have all of the files that the tutorial asked me to copy to that directory.

Last edited by mikedeatworld; 10-24-2006 at 08:26 AM.
 
Old 10-24-2006, 10:53 PM   #5
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Perhaps I'm confused, but you said you created
/mnt/knx/master/KNOPPIX

but then your error output seems to suggest that you tried to chroot into
/mnt/knx/source/KNOPPIX

was this caused by an innocent typo?
 
Old 10-25-2006, 06:50 AM   #6
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Quote:
Originally Posted by mikedeatworld
I have tried to see if my libraries were setup correctly:
Code:
ddevbox:/home# ldd /bin/bash
        libncurses.so.5 => /lib/libncurses.so.5 (0x4002a000)
        libdl.so.2 => /lib/libdl.so.2 (0x4006b000)
        libc.so.6 => /lib/libc.so.6 (0x4006f000)
        /lib/ld-linux.so.2 (0x40000000)
ddevbox:/home#

ddevbox:/# ldd bin/bash
        libncurses.so.5 => /lib/libncurses.so.5 (0x4002a000)
        libdl.so.2 => /lib/libdl.so.2 (0x4006b000)
        libc.so.6 => /lib/libc.so.6 (0x4006f000)
        /lib/ld-linux.so.2 (0x40000000)
ddevbox:/# ls -l lib/libncurses.so.5
lrwxrwxrwx 1 root root 17 Oct 13 09:08 lib/libncurses.so.5 -> libncurses.so.5.5
ddevbox:/# ls -l lib/libdl.so.2
lrwxrwxrwx 1 root root 14 Oct 13 09:08 lib/libdl.so.2 -> libdl-2.3.6.so
ddevbox:/# ls -l lib/ld-linux.so.2
lrwxrwxrwx 1 root root 11 Oct 13 09:08 lib/ld-linux.so.2 -> ld-2.3.6.so
ddevbox:/#
And I checked on bash:

Code:
ddevbox:/# ls -l bin/bash /bin/bash
-rwxr-xr-x 1 root root 676384 Jul  5  2006 /bin/bash
-rwxr-xr-x 1 root root 676384 Jul  5  2006 bin/bash
ddevbox:/#
I haven't read up on the links you posted, but have you checked that your libs and bash are present both "outside" and "inside" the chroot jail?

The code shown above only shows me that:
1. /bin/bash can be located and ldd'ed from your /home directory (=outside of chroot jail).
2. ldd bin/bash also works from the / dir (also outside the jail, since your chroot failed!).
Both ldd thus are performed on /bin/bash (either via absolute path with current dir = /home and via relative path with current dir = /).

To check if you have bash inside your jail, do the following:
Code:
cd /mnt/knx/source/KNOPPIX #you may need to replace "source" with "master", as posted.
#since /mnt/knx/source/KNOPPIX == / inside your chroot jail, you need to have /bin, /etc, etc 
#defined UNDER it. So now do:
ls bin/bash 
#which is equivalent to "ls /mnt/knx/source/KNOPPIX/bin/bash", as long as you haven't chroot'ed
#successfully.
ldd bin/bash
 
  


Reply

Tags
chroot, jail, knoppix, remaster, remastering


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to mount on chroot /mnt/sysimage NickNihal Linux - Hardware 2 09-05-2006 04:07 AM
mount command not working in chroot. and now chroot not working mohit.jain Linux From Scratch 5 07-14-2006 03:57 AM
GCC 4.0.2 Chroot Build Unable to Find Headers Kenji Miyamoto Linux From Scratch 5 06-29-2006 03:34 AM
Tomcat unable to access DNS in chroot flatpaw Linux - Networking 6 05-03-2006 09:42 AM
Unable to get shell when using SSH/CHROOT/PAM_TACPLUS slug420 Linux - Security 0 11-16-2004 09:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration