1833847 Members
2258 Online
110063 Solutions
New Discussion

Symbolic Link Help

 
SOLVED
Go to solution
RedBack
Frequent Advisor

Symbolic Link Help

Im trying to link a directory from / to a mount point. Wen a user creates a file in the directory is will really be in the linked mount point.

I do> ln -s /dirname /mountpoint. This puts dirname inside /mountpoint. I want them to be the be efectivly the same. What am i doing wrong.
5 REPLIES 5
Nag Varma
Advisor

Re: Symbolic Link Help

Hi Mark,

Its the other way round...

For example if you trying to create a directory in the root say /abc and you want to link this to /home mountpoint..so when the user does a cd to /abc , the user goes to /home..then u do..

$ ln -s /home /abc
$ ll /abc
$ lrwxrwxrwx 1 root sys 5 Oct /abc -> /home

Thanks
Nag
Eugeny Brychkov
Honored Contributor

Re: Symbolic Link Help

Mark,
from root directory
ln -s /mountpoint /
after doing this there will be symbolic link creaned with the same name as last dir of mountpoint. The simply rename it
Example:
ln -s /aaa/bbb/ccc /
there will be link "ccc" created in /
mv /ccc /dir
or try
ln -s /mountpoint /dirname
but dirname should not exist.
Eugeny
Eugeny Brychkov
Honored Contributor

Re: Symbolic Link Help

2nd try... :-)
Mark,
from root directory
ln -s /mountpoint /
after doing this there will be symbolic link created with the same name as last dir of mountpoint. Then simply rename it
Example:
ln -s /aaa/bbb/ccc /
there will be symlink "ccc" created in /
mv /ccc /dirname
or try
ln -s /mountpoint /dirname
but "/dirname" should not exist before doing this.
Eugeny
Jean-Louis Phelix
Honored Contributor
Solution

Re: Symbolic Link Help

Hello,

ln works like that :

ln -s source dest

So just like for cp, if dest exist and is a directory, it will create dest/source. In your case you smply wanted to get an new acces to /mountpoint, so /mountpoint is the source.

The rigth command is :

ln -s /mountpoint /dirname

Regards,

Jean-Louis
It works for me (© Bill McNAMARA ...)
RedBack
Frequent Advisor

Re: Symbolic Link Help

Thanks all, I Apologize for my spelling, I guess that is one of the first things to deteriorate when you work 24 hours straight.