FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 01-31-2009, 04:38 PM
Dom Incollingo
 
Default How to Create a Symbolic Link to a Mounted Volume

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

But the link that is created (anotherHome) is not usable.* How can I create a symbolic link to a a mounted volume?

Thanks very much.

Dom

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-01-2009, 12:11 AM
Markus Schönhaber
 
Default How to Create a Symbolic Link to a Mounted Volume

Dom Incollingo:

> I mounted a home directory from another computer via sftp. The directory is
> mounted as:
>
> sftp://dji@linux/home/dji.

I doubt that it's mounted there. That's an URL you can, for example,
type into Nautilus' location bar to access this resource.
Type
mount
to see a list of what is mounted where.

> I tried to make a symbolic link to this directory by running the command
>
> ln -s sftp://dji@linux/home/dji anotherHome
>
> But the link that is created (anotherHome) is not usable. How can I create
> a symbolic link to a a mounted volume?

You can't create usable symlinks pointing to somewhere outside the
filesystem tree.
OTOH: if you use Gnome and did use Nautilus to access this URL, the gvfs
will by default make the root of the remote filesystem accessible trough
a directory below ~/.gvfs. You should be able to create a usable symlink
pointing there.

Out of curiosity: why do you want to do that?

Regards
mks

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-01-2009, 12:42 AM
Derek Broughton
 
Default How to Create a Symbolic Link to a Mounted Volume

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, but the other filesystem must be _mounted_ into
your hierarchy. 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.
...
> Out of curiosity: why do you want to do that?

Because you can? :-)

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.



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-01-2009, 02:22 PM
Markus Schönhaber
 
Default How to Create a Symbolic Link to a Mounted Volume

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

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-01-2009, 05:47 PM
Derek Broughton
 
Default How to Create a Symbolic Link to a Mounted Volume

Markus Schönhaber wrote:

> 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").

Well, you didn't actually _say_ "useful", you said "usable", and yes,
they're definitely usable. I maintain that they're also _useful_.
>
>> but the other filesystem must be _mounted_ into
>> your hierarchy.
>
> Which means that it's *not* *outside* filesystem tree any more.

Well, now, that's an interesting splitting of hairs - in fact they are, by
any definition I've ever read outside the _filesystem_ - they're in your local
directory tree, yes, but not your _filesystem_ tree. I'd have no
disagreement if you'd said "filesystems tree".

>> 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.

Yes you did. And I agree with it. That doesn't mean that the above isn't a
useful or usable concept.

> 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.

I didn't find anything while looking at FUSE filesystems last week, but then I
wasn't specifically looking for ftp:



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-02-2009, 01:05 AM
Dom Incollingo
 
Default How to Create a Symbolic Link to a Mounted Volume

OTOH: if you use Gnome and did use Nautilus to access this URL, the gvfs

will by default make the root of the remote filesystem accessible trough

a directory below ~/.gvfs. You should be able to create a usable symlink

pointing there.



Out of curiosity: why do you want to do that?




Thanks very much for the information.* I found the file system mounted in the ~/.gvfs/ directory, and I made a symlink to it.* It worked like a charm.

As far as why I wanted a symlink....* I'm running a Java app under JBoss, and have been having problems with it.* One of my co-workers suggested having JBoss point to a symlink for the remote file structure it needs to access.* (Possibly because of the embedded spaces in the name of the file structure name mounted in ~/.gvfs ??)


At any rate, the app is running fine now, and I now know how to find the place where Gnome is actually mounting the volume.* Thank again for your help and comments.

Dom

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-02-2009, 09:06 AM
Markus Schönhaber
 
Default How to Create a Symbolic Link to a Mounted Volume

Dom Incollingo:

> Thanks very much for the information. I found the file system mounted in
> the ~/.gvfs/ directory, and I made a symlink to it. It worked like a charm.

Good to hear you got it working.

> As far as why I wanted a symlink.... I'm running a Java app under JBoss,
> and have been having problems with it. One of my co-workers suggested
> having JBoss point to a symlink for the remote file structure it needs to
> access. (Possibly because of the embedded spaces in the name of the file
> structure name mounted in ~/.gvfs ??)

I overcame my laziness and took a quick look at the Ubuntu repositories.
There is indeed a FUSE-based tool to really mount SFTP-resources: sshfs[1].
That might be a better choice for the job since you have control about
where things get mounted and you can obviously avoid having spaces in
the name of the mount point.

> At any rate, the app is running fine now, and I now know how to find the
> place where Gnome is actually mounting the volume. Thank again for your
> help and comments.

You're welcome

Regards
mks

[1] There may be others, too. sshfs was simply the first I saw and it
seems to be working well.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 01:24 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org