mounted nfs share, cannot access symlinked files
Bo Berglund
bo.berglund at gmail.com
Sat Oct 9 05:55:22 UTC 2021
On Sat, 09 Oct 2021 10:56:50 +1100, Karl Auer <kauer at biplane.com.au> wrote:
>A symlink is just a name. Whatever that name is *in context* will be
>used as the real file. So if you set up a symlink to e.g.
>"/usr/bin/whatever" but use that symlink via NFS, then your local
>system will look for /usr/bin/whatever *locally* - like your partner
>looking in the local oven instead of the remote oven.
OUCH!
I thought that a file in a directory which is shared by nfs (or samba for that
matter) would be presented to the share's user as a *file* and that the
de-referencing of links would happen on the *source* (the computer which is
sharing) so that the remote computer would be non the wiser about *where* on the
source file system the file actually resides...
It seemed natural for me that the sharing subsystem (nfs or samba) would handle
this transparently to the user.
But what you infer is that instead of presenting the actual *content* of the
file the nfs sharing presents the verbatim link instead....
Obviously this will not work across a network since the file's address (the
link) has no meaning on the client machine.
This means that one cannot share any part of the file system, where these links
are used because the files will not be available! I had no idea such a
limitation existed.
The only way out would be to share the bin dir where all the files actually
live, but then it would not be possible to have a *selection* of some but not
all files available to the share user system.
Or else on the server machine place these files into a different directory below
the share point and then do the symlinks the *other* way so that the local bin
dir contains the links to the local (shared) directory files.
This way the scripts will be usable on the source system like before and they
would also be available to the guest system as files (to copy from but not
executable there).
And the goal of having only one real file would be reached, no copies which one
has to know about and maintain separately...
--
Bo Berglund
Developer in Sweden
More information about the ubuntu-users
mailing list