Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: Red Hat (and look-alike), SUSE (when drunk), Slackware (when mad)
Posts: 148
Rep:
Cannot 'chroot'
After typing the command:
Code:
chroot /opt/insight /bin/bash -login
I get the output:
Code:
chroot: /bin/bash: No such file or directory
I have made some checks, and the /bin/bash file exists normaly as well as the /opt/insight directory. Don't know why I am doing this, I only go by the book (some manual).
Maybe /opt/insight/bin/bash is dynamically linked against something outside the chroot. I think that would give the same error message. Try linking bash statically. You could also install a dynamic linker and shared objects in the chrooted environment but thats much harder and more time consuming. If you're planning to run lots of stuff from inside the chroot, though, it could save you lots of memory.
btw, "chroot /opt/insight" is the same as "chroot /opt/insight /bin/sh"
Distribution: Red Hat (and look-alike), SUSE (when drunk), Slackware (when mad)
Posts: 148
Original Poster
Rep:
Thanks for the reply. As time passes by, I make a deeper research about the "chroot" thing... What is all this about, after all? From my pov it is a way to say that temporarily the root directory is going to be the "/opt/insight" right? So what is the meaning of this. Theoretically, I can chdir to /opt/insight and do whatever I need to do.
Thats pretty much correct. But there is another important point. Once you're inside the chroot'ed environment, you can't see anything outside it. This means you can only run programs that are self-contained withing the /opt/insight directory. Most programs link dynamically against libraries in /lib and /usr/lib. If you want to run any programs from inside the chroot, they must not link against any libraries outside the chroot. You can achieve this either by linking them all statically or by installing a dynamic linker inside /opt/insight and linking the binaries with that linker.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.