LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 12-06-2007, 04:49 AM   #1
amn
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, 05:28 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
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, 01:09 AM   #3
amn
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...
 
  


Reply

Tags
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 11:26 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM
"shutdown" and "halt" symlinks: poweroff, reboot. sud_crow Linux From Scratch 11 10-17-2006 11:03 PM
serving website from inside chroot "Permissions" jeffpoulsen Linux - Security 1 07-01-2004 01:55 PM


All times are GMT -5. The time now is 11:44 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration