2

I'm new to modifying links as well as administering Linux, Is it possible to soft link a specific folder to a remote server's folder?

(I'm not sure what to use hardlinks/symlinks/etc.)

Sorry for being a newb.

Any help would be awesome.

Thanks!

3 Answers 3

5

You have to use soft links (aka symlinks) as follows:

ln -s /net/server/some/dir /home/me/mysymlink

If your current working directory is currently /home/me, then you can type this instead:

ln -s /net/server/some/dir mysymlink
5
  • So Basically, I am on a say DIR, I should send a command that goes: <pre> ln -s /homeserver/home/DIR /remote/home/RDIR <code> it the "DIR" that I want to symlink to /remote/home/RDIR. Is that code correct? Jun 27, 2012 at 15:55
  • Not sure how to parse your question, but the symlink is always the 2nd parameter to ln -s .... The 1st parameter is the file or directory that already exists.
    – Fran
    Jun 27, 2012 at 17:01
  • 1
    this is not going to work. he wants to link a local file or directory into a remote directory for other clients accessing the remote directory to inspect. that is, the reverse of the solution you described. Jun 27, 2012 at 18:44
  • 1
    @spyroboy I can see how his question could mean that. Too bad he asked it so poorly.
    – Fran
    Jun 27, 2012 at 19:40
  • @Fran now that you mention it, it is very vague ... Jun 29, 2012 at 20:13
0

what filesystems are involved in this configuration? are you using NFS? are you using CIFS/Samba?

you cannot accomplish this from the local filesystem.

given clientA and clientB are accessing remoteA you cannot simply run user@clientA # ln -s /local/file /remote/directory as remoteA and clientB would read /remote/directory/file in local scope. that is, when clientB is accessing /remote/directory/file clientB would be accessing /local/file on clientB's hard drive and not on clientA's hard drive.

the way you solve this is to copy the files to remoteA or create a network mount from clientA to remoteA but this needs to be done on remoteA.

this is very vague but without a specification of your configuration, I cannot really help further.

0

You can mount the remote filesystem locally (or the local system remotely), which is similar to want, but this depends on the filesystems on each end. If you're doing it from linux to linux, you can most likely use sshfs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .