How to Create a Symbolic Link to a Mounted Volume
Markus Schönhaber
ubuntu-users at list-post.mks-mail.de
Sun Feb 1 15:22:00 UTC 2009
Derek Broughton:
> Markus Schönhaber wrote:
>
>> Dom Incollingo:
>>
>>> I mounted a home directory from another computer via sftp. The directory
>>> is mounted as:
>>>
>>> sftp://dji@linux/home/dji.
>>> I tried to make a symbolic link to this directory by running the command
>>>
>>> ln -s sftp://dji@linux/home/dji anotherHome
>> You can't create usable symlinks pointing to somewhere outside the
>> filesystem tree.
>
> Of course, you really can,
No, you can't (notice the word "useful").
> but the other filesystem must be _mounted_ into
> your hierarchy.
Which means that it's *not* *outside* filesystem tree any more.
> My /etc/fstab has a number of entries like:
> //DOMAIN/SHARE /home/derek/DOM_MOUNT cifs \
> noauto,user,credentials=/home/derek/.cred,rw 0 0
>
> and after I "mount ~/DOM_MOUNT" I can treat it like a local mount -
> including making symlinks to files in its own filesystem.
I already gave the OP one possible solution to create a symlink that is
actually usable pointing to the sftp server's file system.
>> Out of curiosity: why do you want to do that?
>
> Because you can? :-)
OK, valid explanation. But it still leaves me curious.
> Seems to me that a great deal of effort has been put into both KDE & Gnome to
> make it possible to treat remotely "accessed" (as opposed to explicitly
> mounted) filesystems as if they're local.
>
> The problem in this case is that, as Markus points out, it's something that
> _Gnome_ can do (and I'd just like to mention that KDE has been able to do it
> for much longer!) but if you're working in the CLI at the level of "ln",
> then you're working at the same level as "mount", and you need the filesystem
> explicitly mounted before you can do things like that.
Well, as I already pointed out in my previous post, GVFS creates
something that is actually usable as a target for ln -s. Although typing
"sftp://<something>" into Nautilus' location bar doesn't really mount
the remote filesystem separately, it's made accessible through a folder
below ~/.gvfs which itself is indeed a mount point.
But that's just nitpicking: I agree that it may not bee too desirable in
the long run to rely on a mix of GUI and command line tools.
I'm too lazy to check now, but I'd be surprised if no-one had written
something (for example using FUSE) that really mounts a sftp filesystem,
which might be a more adequate tool for the job.
Regards
mks
More information about the ubuntu-users
mailing list