Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-06-2007, 05:49 AM   #1
LQ Newbie
Registered: Mar 2007
Posts: 17

Rep: Reputation: 0
Question Symlinks working from "inside" 'chroot' to "outside" ?

Hi all,

I am building a script which will bootstrap a linux installation, and at one point doing a chroot to the target system "root" directory. But since my install scripts are also needed by the target installation, and they are located outside chrooted "root" directory, how can I reach them? I do not want to copy them to some place inside chroot, but i thought of creating a /tmp/install-scripts symlink which will point to a location outside chroot, however i am not sure the filesystem will be able to locate the target of such link?

Simpler put i have a host system with a bash shell running scripts from directory /mnt/my-usb-stick/install/install-script-1, which does a chroot into a, say, /mnt/install-target. Since all installation is scripted, chroot is too, and does a "env -i" environment cleanup which in turn calls another script. THe problem is, that another script already running from chrooted tree, will not be able to locate the /mnt/my-usb-stick/install/* since its a chrooted system..

Hope this makes sense. Thanks in advance.
Old 12-06-2007, 06:28 AM   #2
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
You need to use "bind mount" if you want to create a link from inside the chroot to outside. And you need to run the mount command out of chroot..

mount /out/side /chroot/point_to_outside -o bind
Old 12-07-2007, 02:09 AM   #3
LQ Newbie
Registered: Mar 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks, i already figured it out. I did exactly as you said

Forgive me for starting a thread without googling first...


automated, chroot, script, symlink

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
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 12:26 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 09:31 AM
"shutdown" and "halt" symlinks: poweroff, reboot. sud_crow Linux From Scratch 11 10-18-2006 12:03 AM
serving website from inside chroot "Permissions" jeffpoulsen Linux - Security 1 07-01-2004 02:55 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:57 PM.

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