LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   symbolic link question (https://www.linuxquestions.org/questions/linux-newbie-8/symbolic-link-question-737018/)

deibertine 07-01-2009 02:45 PM

symbolic link question
 
I have /home/dbertine in which needed to mv to /mnt/sda1 for our product support reasons.

So I did move the entire /home/dbertine to /mnt/sda1 and created a symblink by doing this:
ln -s /mnt/sda1/dbertine dbertine

This way I can still have my home directory under /home.

However due to some circumstance within my running scripts, this is now showing:
/mnt/sda1/dbertine/sql/query/scripts/1276/collect/train.db....

which is going to be a problem. :(

The script need to show /home/dbertine/sql/query/scripts/1276/collect/train.db.... instead of /mnt/sda1.

Is there a way that I can configure this to show /home/dbertine but still having the physical dir in /mnt/sda1? Not sure if that will create chaos.

Any advise is appreciated.

Thanks,
DB

Poetics 07-01-2009 02:57 PM

How it displays, and what it reads, is going to be all in the script itself.

What happens when you `cd` into /home/dbertine ? Do you see the files you'd expect on /mnt/sda1?

deibertine 07-01-2009 03:18 PM

Quote:

Originally Posted by Poetics (Post 3593345)
How it displays, and what it reads, is going to be all in the script itself.

What happens when you `cd` into /home/dbertine ? Do you see the files you'd expect on /mnt/sda1?

Trying to avoid changing the path of the scripts (tons of them) but I think you're right.

When I cd into /home/dbertine I can see the files I need and do a pwd i see /home/dbertine

However the script is looking into the actual physical location which is /mnt/sda1/dbertine
0 lrwxrwxrwx 1 root root 15 Jul 1 11:12 dbertine -> /mnt/sda1/dbertine

Is there other alternative way to possibly reconfigure this?

Thanks.

norobro 07-01-2009 04:52 PM

I think "mount --bind" will do what you want. Check out the mount man page.

i92guboj 07-01-2009 05:15 PM

I can't really tell without looking at the script.

Just bear in mind that some programs will use the raw path, as passed. Some others will deference it and use the real path instead. Some others will act in one or another way depending on some command line switch. So, we first would need to look at the script, see how it handles the paths and what commands/tools uses, and then fix the problem.

Alternatively, just mount -obind instead of symlinking. It should just make your problem disappear.


All times are GMT -5. The time now is 04:16 AM.