Symlink from one workstation to another without mount

Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
I am trying to create a symlink of a file on one linux workstation to another linux workstation, without having to 'mount' any network shares. Here's what I am trying to do, but can't get it to work.
ln -s /link/to/local/file.mov //10.0.1.103/sharedFolder/symlinkFile.mov
linux symlink remote ln
add a comment |
up vote
4
down vote
favorite
I am trying to create a symlink of a file on one linux workstation to another linux workstation, without having to 'mount' any network shares. Here's what I am trying to do, but can't get it to work.
ln -s /link/to/local/file.mov //10.0.1.103/sharedFolder/symlinkFile.mov
linux symlink remote ln
1
You need-sto make a symlink; otherwise you're trying to make a hard link, and those can only be made on the same filesystem.
– deltab
Jul 21 '14 at 5:24
Sorry, missed off the -s. I have now added it.
– speedyrazor
Jul 21 '14 at 5:27
When you say "can't get it to work", what actually happens when you try? Also, what are you using that would make//10.0.1.103refer to another machine, and not just a subdirectory of/called10.0.1.103?
– deltab
Jul 21 '14 at 5:33
I have updated the question to show that on //10.0.1.103 (the other linux workstation on the same network) has a shared folder (sharedFolder). So rather than mounting that shared folder, can I just link straight to it, like you can on Windows PC?
– speedyrazor
Jul 21 '14 at 5:39
If you have not mounted any network share then said symlink will be "dangling" pointer. Why you want to do this ?
– SHW
Jul 21 '14 at 5:56
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I am trying to create a symlink of a file on one linux workstation to another linux workstation, without having to 'mount' any network shares. Here's what I am trying to do, but can't get it to work.
ln -s /link/to/local/file.mov //10.0.1.103/sharedFolder/symlinkFile.mov
linux symlink remote ln
I am trying to create a symlink of a file on one linux workstation to another linux workstation, without having to 'mount' any network shares. Here's what I am trying to do, but can't get it to work.
ln -s /link/to/local/file.mov //10.0.1.103/sharedFolder/symlinkFile.mov
linux symlink remote ln
linux symlink remote ln
edited Jul 21 '14 at 5:38
asked Jul 21 '14 at 5:14
speedyrazor
123115
123115
1
You need-sto make a symlink; otherwise you're trying to make a hard link, and those can only be made on the same filesystem.
– deltab
Jul 21 '14 at 5:24
Sorry, missed off the -s. I have now added it.
– speedyrazor
Jul 21 '14 at 5:27
When you say "can't get it to work", what actually happens when you try? Also, what are you using that would make//10.0.1.103refer to another machine, and not just a subdirectory of/called10.0.1.103?
– deltab
Jul 21 '14 at 5:33
I have updated the question to show that on //10.0.1.103 (the other linux workstation on the same network) has a shared folder (sharedFolder). So rather than mounting that shared folder, can I just link straight to it, like you can on Windows PC?
– speedyrazor
Jul 21 '14 at 5:39
If you have not mounted any network share then said symlink will be "dangling" pointer. Why you want to do this ?
– SHW
Jul 21 '14 at 5:56
add a comment |
1
You need-sto make a symlink; otherwise you're trying to make a hard link, and those can only be made on the same filesystem.
– deltab
Jul 21 '14 at 5:24
Sorry, missed off the -s. I have now added it.
– speedyrazor
Jul 21 '14 at 5:27
When you say "can't get it to work", what actually happens when you try? Also, what are you using that would make//10.0.1.103refer to another machine, and not just a subdirectory of/called10.0.1.103?
– deltab
Jul 21 '14 at 5:33
I have updated the question to show that on //10.0.1.103 (the other linux workstation on the same network) has a shared folder (sharedFolder). So rather than mounting that shared folder, can I just link straight to it, like you can on Windows PC?
– speedyrazor
Jul 21 '14 at 5:39
If you have not mounted any network share then said symlink will be "dangling" pointer. Why you want to do this ?
– SHW
Jul 21 '14 at 5:56
1
1
You need
-s to make a symlink; otherwise you're trying to make a hard link, and those can only be made on the same filesystem.– deltab
Jul 21 '14 at 5:24
You need
-s to make a symlink; otherwise you're trying to make a hard link, and those can only be made on the same filesystem.– deltab
Jul 21 '14 at 5:24
Sorry, missed off the -s. I have now added it.
– speedyrazor
Jul 21 '14 at 5:27
Sorry, missed off the -s. I have now added it.
– speedyrazor
Jul 21 '14 at 5:27
When you say "can't get it to work", what actually happens when you try? Also, what are you using that would make
//10.0.1.103 refer to another machine, and not just a subdirectory of / called 10.0.1.103?– deltab
Jul 21 '14 at 5:33
When you say "can't get it to work", what actually happens when you try? Also, what are you using that would make
//10.0.1.103 refer to another machine, and not just a subdirectory of / called 10.0.1.103?– deltab
Jul 21 '14 at 5:33
I have updated the question to show that on //10.0.1.103 (the other linux workstation on the same network) has a shared folder (sharedFolder). So rather than mounting that shared folder, can I just link straight to it, like you can on Windows PC?
– speedyrazor
Jul 21 '14 at 5:39
I have updated the question to show that on //10.0.1.103 (the other linux workstation on the same network) has a shared folder (sharedFolder). So rather than mounting that shared folder, can I just link straight to it, like you can on Windows PC?
– speedyrazor
Jul 21 '14 at 5:39
If you have not mounted any network share then said symlink will be "dangling" pointer. Why you want to do this ?
– SHW
Jul 21 '14 at 5:56
If you have not mounted any network share then said symlink will be "dangling" pointer. Why you want to do this ?
– SHW
Jul 21 '14 at 5:56
add a comment |
3 Answers
3
active
oldest
votes
up vote
10
down vote
accepted
You can't:
A symlink is simply an extra inode (a structure that points to the file) and this inode consists of, amongst other things, a deviceId and an inode pointer. The deviceId effectively points to a device special file within the /dev directory and the inode pointer points to a block on that device.
Your network location of 10.0.1.103 does not and cannot have an deviceId (it's not in /dev) therefore you can't possibly have a symlink to a network location.
On the other hand, a mounted network share will have a deviceId which is why you can create a symlink to a mounted location.
1
Not the answer I wanted, but honest and clear, cheers.
– speedyrazor
Jul 21 '14 at 11:29
1
That is not how symlinks work.
– Michael Homer
Mar 1 '17 at 21:37
@MichaelHomer +1 For correct explanation of symbolic links see stackoverflow.com/questions/16912997
– stek29
Mar 12 at 21:01
add a comment |
up vote
6
down vote
Windows has a special syntax \MACHINEDIRECTORY…FILE meaning the file located at DIRECTORY…FILE on the machine called \MACHINE over the SMB protocol. This is built into the operating system and specialized to one network protocol.
Linux has a flexible filesystem based on the notion of mounting. Filesystems are attached to an existing directory, and the administrator gets to choose how to arrange the directory hierarchy. For more background, read What is meant by mounting a device in Linux?, Why is Linux's filesystem designed as a single directory tree? and What mount points exist on a typical Linux system?. Linux supports many network filesystems (i.e. filesystems that allow one machine to access files on another machine), including NFS, SMB, SSHFS, etc.
NFS can be considered Linux's native network filesystem, the way SMB is Windows's. However Linux doesn't export its files by default: you need to install an NFS server. An NFS server is available in all Linux distributions, but requires a bit of setup (you need to register the directories you want to export in the file /etc/exports). Furthermore NFS is from a gentler time when attackers on the local network weren't a concern, and securing it requires a bit of knowledge about firewalls which is beyond the scope of this answer. To make the directory /some/where from the remote machine foo.example.com available at the location /local/dir (which must be an existing directory), assuming that it is exported by the remote machine, run the following command as root:
mount foo.example.com:/some/where /local/dir
The easy way to access remote files with next to no setup is over SSHFS. All you need is to install an SSH server on the remote machine, and the sshfs package on the local machine. You should also generate a key (see How to make password-less login work), though you don't have to do it if you don't mind entering your password each time. SSH is additionally useful to run commands on the remote machine. To make the directory /some/where from the remote machine foo.example.com available at the location /local/dir (which must be an existing directory) over SSHFS, run the following command (as your usual user):
sshfs foo.example.com:/some/where /local/dir
Linux can be a server or a client for the SMB protocol (communicating with Windows machines, or even with other Linux machines though it's less well integrated than other protocols) through the Samba software.
You can set up an automounter (such as autofs) so that accessing certain directories automatically mounts directories from some remote machine. For example, a common configuration arranges that the autofs filesystem is mounted on the directory /net, and accessing /net/MACHINE/DIRECTORY causes the remote directory /DIRECTORY from /net/MACHINE to be mounted over NFS at that location (and it will be unmounted after a certain period of inactivity). The remote machine must of course have an NFS server set up and allowing that connection.
It is possible to set up an automounter with SSHFS. See Totally Seamless SSHFS under Linux using Fuse and Autofs and Autofs and sshfs – the perfect couple for quick tutorials; in a nutshell:
- Install
autofsandsshfs. Add the following line to
/etc/auto.master:/mnt/sshfs /etc/auto.sshfs uid=1000,gid=1000,--timeout=30,--ghostReplace the two occurrences of 1000 by your user id and group id (run
id -uandid -gto show these values). Create the directory/mnt/sshfs.Create a file
/etc/auto.sshfscontaining lines like the following:machinename -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536 :sshfs#machinename.example.com:where
machinename.example.comis the host name (or IP address) of the remote machine andmachinenameis the name you want to access it as locally, via the path/mnt/sshfs/machinename.
Autosshfs provides a more convenient autofs+sshfs setup.
Finally, regarding the symbolic part: you can create a symbolic link to a non-existent path. The symbolic link is the second argument, so you'll need something like
ln -s /net/10.0.1.103/sharedFolder/symlinkFile.mov /link/to/local/file.mov
You'll need to manually or automatically arrange for /sharedFolder from 10.0.1.103 to be mounted at /net/10.0.1.103/sharedFolder.
add a comment |
up vote
0
down vote
For what it's worth ...
I have worked on a small tool called lionfs which is based on Raphael S. Carvalho's GhostFS. The goal is to allow symbolic links pointing to an URI. It is fairly incomplete, have a lot of issues, and currently supports only HTTP. FUSE (Filesystem in Userspace) is used to handle the background.
1
Please be more specific of what it does and how it helps OP, at first I thought it might to automagic mounting but apparently this is not the case, it's just for offering HTTP served content as a FS?! This does not seem what OP wanted.
– phk
Oct 26 '16 at 19:07
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
10
down vote
accepted
You can't:
A symlink is simply an extra inode (a structure that points to the file) and this inode consists of, amongst other things, a deviceId and an inode pointer. The deviceId effectively points to a device special file within the /dev directory and the inode pointer points to a block on that device.
Your network location of 10.0.1.103 does not and cannot have an deviceId (it's not in /dev) therefore you can't possibly have a symlink to a network location.
On the other hand, a mounted network share will have a deviceId which is why you can create a symlink to a mounted location.
1
Not the answer I wanted, but honest and clear, cheers.
– speedyrazor
Jul 21 '14 at 11:29
1
That is not how symlinks work.
– Michael Homer
Mar 1 '17 at 21:37
@MichaelHomer +1 For correct explanation of symbolic links see stackoverflow.com/questions/16912997
– stek29
Mar 12 at 21:01
add a comment |
up vote
10
down vote
accepted
You can't:
A symlink is simply an extra inode (a structure that points to the file) and this inode consists of, amongst other things, a deviceId and an inode pointer. The deviceId effectively points to a device special file within the /dev directory and the inode pointer points to a block on that device.
Your network location of 10.0.1.103 does not and cannot have an deviceId (it's not in /dev) therefore you can't possibly have a symlink to a network location.
On the other hand, a mounted network share will have a deviceId which is why you can create a symlink to a mounted location.
1
Not the answer I wanted, but honest and clear, cheers.
– speedyrazor
Jul 21 '14 at 11:29
1
That is not how symlinks work.
– Michael Homer
Mar 1 '17 at 21:37
@MichaelHomer +1 For correct explanation of symbolic links see stackoverflow.com/questions/16912997
– stek29
Mar 12 at 21:01
add a comment |
up vote
10
down vote
accepted
up vote
10
down vote
accepted
You can't:
A symlink is simply an extra inode (a structure that points to the file) and this inode consists of, amongst other things, a deviceId and an inode pointer. The deviceId effectively points to a device special file within the /dev directory and the inode pointer points to a block on that device.
Your network location of 10.0.1.103 does not and cannot have an deviceId (it's not in /dev) therefore you can't possibly have a symlink to a network location.
On the other hand, a mounted network share will have a deviceId which is why you can create a symlink to a mounted location.
You can't:
A symlink is simply an extra inode (a structure that points to the file) and this inode consists of, amongst other things, a deviceId and an inode pointer. The deviceId effectively points to a device special file within the /dev directory and the inode pointer points to a block on that device.
Your network location of 10.0.1.103 does not and cannot have an deviceId (it's not in /dev) therefore you can't possibly have a symlink to a network location.
On the other hand, a mounted network share will have a deviceId which is why you can create a symlink to a mounted location.
answered Jul 21 '14 at 10:17
garethTheRed
23.6k35978
23.6k35978
1
Not the answer I wanted, but honest and clear, cheers.
– speedyrazor
Jul 21 '14 at 11:29
1
That is not how symlinks work.
– Michael Homer
Mar 1 '17 at 21:37
@MichaelHomer +1 For correct explanation of symbolic links see stackoverflow.com/questions/16912997
– stek29
Mar 12 at 21:01
add a comment |
1
Not the answer I wanted, but honest and clear, cheers.
– speedyrazor
Jul 21 '14 at 11:29
1
That is not how symlinks work.
– Michael Homer
Mar 1 '17 at 21:37
@MichaelHomer +1 For correct explanation of symbolic links see stackoverflow.com/questions/16912997
– stek29
Mar 12 at 21:01
1
1
Not the answer I wanted, but honest and clear, cheers.
– speedyrazor
Jul 21 '14 at 11:29
Not the answer I wanted, but honest and clear, cheers.
– speedyrazor
Jul 21 '14 at 11:29
1
1
That is not how symlinks work.
– Michael Homer
Mar 1 '17 at 21:37
That is not how symlinks work.
– Michael Homer
Mar 1 '17 at 21:37
@MichaelHomer +1 For correct explanation of symbolic links see stackoverflow.com/questions/16912997
– stek29
Mar 12 at 21:01
@MichaelHomer +1 For correct explanation of symbolic links see stackoverflow.com/questions/16912997
– stek29
Mar 12 at 21:01
add a comment |
up vote
6
down vote
Windows has a special syntax \MACHINEDIRECTORY…FILE meaning the file located at DIRECTORY…FILE on the machine called \MACHINE over the SMB protocol. This is built into the operating system and specialized to one network protocol.
Linux has a flexible filesystem based on the notion of mounting. Filesystems are attached to an existing directory, and the administrator gets to choose how to arrange the directory hierarchy. For more background, read What is meant by mounting a device in Linux?, Why is Linux's filesystem designed as a single directory tree? and What mount points exist on a typical Linux system?. Linux supports many network filesystems (i.e. filesystems that allow one machine to access files on another machine), including NFS, SMB, SSHFS, etc.
NFS can be considered Linux's native network filesystem, the way SMB is Windows's. However Linux doesn't export its files by default: you need to install an NFS server. An NFS server is available in all Linux distributions, but requires a bit of setup (you need to register the directories you want to export in the file /etc/exports). Furthermore NFS is from a gentler time when attackers on the local network weren't a concern, and securing it requires a bit of knowledge about firewalls which is beyond the scope of this answer. To make the directory /some/where from the remote machine foo.example.com available at the location /local/dir (which must be an existing directory), assuming that it is exported by the remote machine, run the following command as root:
mount foo.example.com:/some/where /local/dir
The easy way to access remote files with next to no setup is over SSHFS. All you need is to install an SSH server on the remote machine, and the sshfs package on the local machine. You should also generate a key (see How to make password-less login work), though you don't have to do it if you don't mind entering your password each time. SSH is additionally useful to run commands on the remote machine. To make the directory /some/where from the remote machine foo.example.com available at the location /local/dir (which must be an existing directory) over SSHFS, run the following command (as your usual user):
sshfs foo.example.com:/some/where /local/dir
Linux can be a server or a client for the SMB protocol (communicating with Windows machines, or even with other Linux machines though it's less well integrated than other protocols) through the Samba software.
You can set up an automounter (such as autofs) so that accessing certain directories automatically mounts directories from some remote machine. For example, a common configuration arranges that the autofs filesystem is mounted on the directory /net, and accessing /net/MACHINE/DIRECTORY causes the remote directory /DIRECTORY from /net/MACHINE to be mounted over NFS at that location (and it will be unmounted after a certain period of inactivity). The remote machine must of course have an NFS server set up and allowing that connection.
It is possible to set up an automounter with SSHFS. See Totally Seamless SSHFS under Linux using Fuse and Autofs and Autofs and sshfs – the perfect couple for quick tutorials; in a nutshell:
- Install
autofsandsshfs. Add the following line to
/etc/auto.master:/mnt/sshfs /etc/auto.sshfs uid=1000,gid=1000,--timeout=30,--ghostReplace the two occurrences of 1000 by your user id and group id (run
id -uandid -gto show these values). Create the directory/mnt/sshfs.Create a file
/etc/auto.sshfscontaining lines like the following:machinename -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536 :sshfs#machinename.example.com:where
machinename.example.comis the host name (or IP address) of the remote machine andmachinenameis the name you want to access it as locally, via the path/mnt/sshfs/machinename.
Autosshfs provides a more convenient autofs+sshfs setup.
Finally, regarding the symbolic part: you can create a symbolic link to a non-existent path. The symbolic link is the second argument, so you'll need something like
ln -s /net/10.0.1.103/sharedFolder/symlinkFile.mov /link/to/local/file.mov
You'll need to manually or automatically arrange for /sharedFolder from 10.0.1.103 to be mounted at /net/10.0.1.103/sharedFolder.
add a comment |
up vote
6
down vote
Windows has a special syntax \MACHINEDIRECTORY…FILE meaning the file located at DIRECTORY…FILE on the machine called \MACHINE over the SMB protocol. This is built into the operating system and specialized to one network protocol.
Linux has a flexible filesystem based on the notion of mounting. Filesystems are attached to an existing directory, and the administrator gets to choose how to arrange the directory hierarchy. For more background, read What is meant by mounting a device in Linux?, Why is Linux's filesystem designed as a single directory tree? and What mount points exist on a typical Linux system?. Linux supports many network filesystems (i.e. filesystems that allow one machine to access files on another machine), including NFS, SMB, SSHFS, etc.
NFS can be considered Linux's native network filesystem, the way SMB is Windows's. However Linux doesn't export its files by default: you need to install an NFS server. An NFS server is available in all Linux distributions, but requires a bit of setup (you need to register the directories you want to export in the file /etc/exports). Furthermore NFS is from a gentler time when attackers on the local network weren't a concern, and securing it requires a bit of knowledge about firewalls which is beyond the scope of this answer. To make the directory /some/where from the remote machine foo.example.com available at the location /local/dir (which must be an existing directory), assuming that it is exported by the remote machine, run the following command as root:
mount foo.example.com:/some/where /local/dir
The easy way to access remote files with next to no setup is over SSHFS. All you need is to install an SSH server on the remote machine, and the sshfs package on the local machine. You should also generate a key (see How to make password-less login work), though you don't have to do it if you don't mind entering your password each time. SSH is additionally useful to run commands on the remote machine. To make the directory /some/where from the remote machine foo.example.com available at the location /local/dir (which must be an existing directory) over SSHFS, run the following command (as your usual user):
sshfs foo.example.com:/some/where /local/dir
Linux can be a server or a client for the SMB protocol (communicating with Windows machines, or even with other Linux machines though it's less well integrated than other protocols) through the Samba software.
You can set up an automounter (such as autofs) so that accessing certain directories automatically mounts directories from some remote machine. For example, a common configuration arranges that the autofs filesystem is mounted on the directory /net, and accessing /net/MACHINE/DIRECTORY causes the remote directory /DIRECTORY from /net/MACHINE to be mounted over NFS at that location (and it will be unmounted after a certain period of inactivity). The remote machine must of course have an NFS server set up and allowing that connection.
It is possible to set up an automounter with SSHFS. See Totally Seamless SSHFS under Linux using Fuse and Autofs and Autofs and sshfs – the perfect couple for quick tutorials; in a nutshell:
- Install
autofsandsshfs. Add the following line to
/etc/auto.master:/mnt/sshfs /etc/auto.sshfs uid=1000,gid=1000,--timeout=30,--ghostReplace the two occurrences of 1000 by your user id and group id (run
id -uandid -gto show these values). Create the directory/mnt/sshfs.Create a file
/etc/auto.sshfscontaining lines like the following:machinename -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536 :sshfs#machinename.example.com:where
machinename.example.comis the host name (or IP address) of the remote machine andmachinenameis the name you want to access it as locally, via the path/mnt/sshfs/machinename.
Autosshfs provides a more convenient autofs+sshfs setup.
Finally, regarding the symbolic part: you can create a symbolic link to a non-existent path. The symbolic link is the second argument, so you'll need something like
ln -s /net/10.0.1.103/sharedFolder/symlinkFile.mov /link/to/local/file.mov
You'll need to manually or automatically arrange for /sharedFolder from 10.0.1.103 to be mounted at /net/10.0.1.103/sharedFolder.
add a comment |
up vote
6
down vote
up vote
6
down vote
Windows has a special syntax \MACHINEDIRECTORY…FILE meaning the file located at DIRECTORY…FILE on the machine called \MACHINE over the SMB protocol. This is built into the operating system and specialized to one network protocol.
Linux has a flexible filesystem based on the notion of mounting. Filesystems are attached to an existing directory, and the administrator gets to choose how to arrange the directory hierarchy. For more background, read What is meant by mounting a device in Linux?, Why is Linux's filesystem designed as a single directory tree? and What mount points exist on a typical Linux system?. Linux supports many network filesystems (i.e. filesystems that allow one machine to access files on another machine), including NFS, SMB, SSHFS, etc.
NFS can be considered Linux's native network filesystem, the way SMB is Windows's. However Linux doesn't export its files by default: you need to install an NFS server. An NFS server is available in all Linux distributions, but requires a bit of setup (you need to register the directories you want to export in the file /etc/exports). Furthermore NFS is from a gentler time when attackers on the local network weren't a concern, and securing it requires a bit of knowledge about firewalls which is beyond the scope of this answer. To make the directory /some/where from the remote machine foo.example.com available at the location /local/dir (which must be an existing directory), assuming that it is exported by the remote machine, run the following command as root:
mount foo.example.com:/some/where /local/dir
The easy way to access remote files with next to no setup is over SSHFS. All you need is to install an SSH server on the remote machine, and the sshfs package on the local machine. You should also generate a key (see How to make password-less login work), though you don't have to do it if you don't mind entering your password each time. SSH is additionally useful to run commands on the remote machine. To make the directory /some/where from the remote machine foo.example.com available at the location /local/dir (which must be an existing directory) over SSHFS, run the following command (as your usual user):
sshfs foo.example.com:/some/where /local/dir
Linux can be a server or a client for the SMB protocol (communicating with Windows machines, or even with other Linux machines though it's less well integrated than other protocols) through the Samba software.
You can set up an automounter (such as autofs) so that accessing certain directories automatically mounts directories from some remote machine. For example, a common configuration arranges that the autofs filesystem is mounted on the directory /net, and accessing /net/MACHINE/DIRECTORY causes the remote directory /DIRECTORY from /net/MACHINE to be mounted over NFS at that location (and it will be unmounted after a certain period of inactivity). The remote machine must of course have an NFS server set up and allowing that connection.
It is possible to set up an automounter with SSHFS. See Totally Seamless SSHFS under Linux using Fuse and Autofs and Autofs and sshfs – the perfect couple for quick tutorials; in a nutshell:
- Install
autofsandsshfs. Add the following line to
/etc/auto.master:/mnt/sshfs /etc/auto.sshfs uid=1000,gid=1000,--timeout=30,--ghostReplace the two occurrences of 1000 by your user id and group id (run
id -uandid -gto show these values). Create the directory/mnt/sshfs.Create a file
/etc/auto.sshfscontaining lines like the following:machinename -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536 :sshfs#machinename.example.com:where
machinename.example.comis the host name (or IP address) of the remote machine andmachinenameis the name you want to access it as locally, via the path/mnt/sshfs/machinename.
Autosshfs provides a more convenient autofs+sshfs setup.
Finally, regarding the symbolic part: you can create a symbolic link to a non-existent path. The symbolic link is the second argument, so you'll need something like
ln -s /net/10.0.1.103/sharedFolder/symlinkFile.mov /link/to/local/file.mov
You'll need to manually or automatically arrange for /sharedFolder from 10.0.1.103 to be mounted at /net/10.0.1.103/sharedFolder.
Windows has a special syntax \MACHINEDIRECTORY…FILE meaning the file located at DIRECTORY…FILE on the machine called \MACHINE over the SMB protocol. This is built into the operating system and specialized to one network protocol.
Linux has a flexible filesystem based on the notion of mounting. Filesystems are attached to an existing directory, and the administrator gets to choose how to arrange the directory hierarchy. For more background, read What is meant by mounting a device in Linux?, Why is Linux's filesystem designed as a single directory tree? and What mount points exist on a typical Linux system?. Linux supports many network filesystems (i.e. filesystems that allow one machine to access files on another machine), including NFS, SMB, SSHFS, etc.
NFS can be considered Linux's native network filesystem, the way SMB is Windows's. However Linux doesn't export its files by default: you need to install an NFS server. An NFS server is available in all Linux distributions, but requires a bit of setup (you need to register the directories you want to export in the file /etc/exports). Furthermore NFS is from a gentler time when attackers on the local network weren't a concern, and securing it requires a bit of knowledge about firewalls which is beyond the scope of this answer. To make the directory /some/where from the remote machine foo.example.com available at the location /local/dir (which must be an existing directory), assuming that it is exported by the remote machine, run the following command as root:
mount foo.example.com:/some/where /local/dir
The easy way to access remote files with next to no setup is over SSHFS. All you need is to install an SSH server on the remote machine, and the sshfs package on the local machine. You should also generate a key (see How to make password-less login work), though you don't have to do it if you don't mind entering your password each time. SSH is additionally useful to run commands on the remote machine. To make the directory /some/where from the remote machine foo.example.com available at the location /local/dir (which must be an existing directory) over SSHFS, run the following command (as your usual user):
sshfs foo.example.com:/some/where /local/dir
Linux can be a server or a client for the SMB protocol (communicating with Windows machines, or even with other Linux machines though it's less well integrated than other protocols) through the Samba software.
You can set up an automounter (such as autofs) so that accessing certain directories automatically mounts directories from some remote machine. For example, a common configuration arranges that the autofs filesystem is mounted on the directory /net, and accessing /net/MACHINE/DIRECTORY causes the remote directory /DIRECTORY from /net/MACHINE to be mounted over NFS at that location (and it will be unmounted after a certain period of inactivity). The remote machine must of course have an NFS server set up and allowing that connection.
It is possible to set up an automounter with SSHFS. See Totally Seamless SSHFS under Linux using Fuse and Autofs and Autofs and sshfs – the perfect couple for quick tutorials; in a nutshell:
- Install
autofsandsshfs. Add the following line to
/etc/auto.master:/mnt/sshfs /etc/auto.sshfs uid=1000,gid=1000,--timeout=30,--ghostReplace the two occurrences of 1000 by your user id and group id (run
id -uandid -gto show these values). Create the directory/mnt/sshfs.Create a file
/etc/auto.sshfscontaining lines like the following:machinename -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536 :sshfs#machinename.example.com:where
machinename.example.comis the host name (or IP address) of the remote machine andmachinenameis the name you want to access it as locally, via the path/mnt/sshfs/machinename.
Autosshfs provides a more convenient autofs+sshfs setup.
Finally, regarding the symbolic part: you can create a symbolic link to a non-existent path. The symbolic link is the second argument, so you'll need something like
ln -s /net/10.0.1.103/sharedFolder/symlinkFile.mov /link/to/local/file.mov
You'll need to manually or automatically arrange for /sharedFolder from 10.0.1.103 to be mounted at /net/10.0.1.103/sharedFolder.
edited Apr 13 '17 at 12:36
Community♦
1
1
answered Jul 22 '14 at 1:12
Gilles
519k12410371566
519k12410371566
add a comment |
add a comment |
up vote
0
down vote
For what it's worth ...
I have worked on a small tool called lionfs which is based on Raphael S. Carvalho's GhostFS. The goal is to allow symbolic links pointing to an URI. It is fairly incomplete, have a lot of issues, and currently supports only HTTP. FUSE (Filesystem in Userspace) is used to handle the background.
1
Please be more specific of what it does and how it helps OP, at first I thought it might to automagic mounting but apparently this is not the case, it's just for offering HTTP served content as a FS?! This does not seem what OP wanted.
– phk
Oct 26 '16 at 19:07
add a comment |
up vote
0
down vote
For what it's worth ...
I have worked on a small tool called lionfs which is based on Raphael S. Carvalho's GhostFS. The goal is to allow symbolic links pointing to an URI. It is fairly incomplete, have a lot of issues, and currently supports only HTTP. FUSE (Filesystem in Userspace) is used to handle the background.
1
Please be more specific of what it does and how it helps OP, at first I thought it might to automagic mounting but apparently this is not the case, it's just for offering HTTP served content as a FS?! This does not seem what OP wanted.
– phk
Oct 26 '16 at 19:07
add a comment |
up vote
0
down vote
up vote
0
down vote
For what it's worth ...
I have worked on a small tool called lionfs which is based on Raphael S. Carvalho's GhostFS. The goal is to allow symbolic links pointing to an URI. It is fairly incomplete, have a lot of issues, and currently supports only HTTP. FUSE (Filesystem in Userspace) is used to handle the background.
For what it's worth ...
I have worked on a small tool called lionfs which is based on Raphael S. Carvalho's GhostFS. The goal is to allow symbolic links pointing to an URI. It is fairly incomplete, have a lot of issues, and currently supports only HTTP. FUSE (Filesystem in Userspace) is used to handle the background.
edited 3 hours ago
answered Oct 26 '16 at 18:39
Ricardo Biehl Pasquali
1125
1125
1
Please be more specific of what it does and how it helps OP, at first I thought it might to automagic mounting but apparently this is not the case, it's just for offering HTTP served content as a FS?! This does not seem what OP wanted.
– phk
Oct 26 '16 at 19:07
add a comment |
1
Please be more specific of what it does and how it helps OP, at first I thought it might to automagic mounting but apparently this is not the case, it's just for offering HTTP served content as a FS?! This does not seem what OP wanted.
– phk
Oct 26 '16 at 19:07
1
1
Please be more specific of what it does and how it helps OP, at first I thought it might to automagic mounting but apparently this is not the case, it's just for offering HTTP served content as a FS?! This does not seem what OP wanted.
– phk
Oct 26 '16 at 19:07
Please be more specific of what it does and how it helps OP, at first I thought it might to automagic mounting but apparently this is not the case, it's just for offering HTTP served content as a FS?! This does not seem what OP wanted.
– phk
Oct 26 '16 at 19:07
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f145636%2fsymlink-from-one-workstation-to-another-without-mount%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
You need
-sto make a symlink; otherwise you're trying to make a hard link, and those can only be made on the same filesystem.– deltab
Jul 21 '14 at 5:24
Sorry, missed off the -s. I have now added it.
– speedyrazor
Jul 21 '14 at 5:27
When you say "can't get it to work", what actually happens when you try? Also, what are you using that would make
//10.0.1.103refer to another machine, and not just a subdirectory of/called10.0.1.103?– deltab
Jul 21 '14 at 5:33
I have updated the question to show that on //10.0.1.103 (the other linux workstation on the same network) has a shared folder (sharedFolder). So rather than mounting that shared folder, can I just link straight to it, like you can on Windows PC?
– speedyrazor
Jul 21 '14 at 5:39
If you have not mounted any network share then said symlink will be "dangling" pointer. Why you want to do this ?
– SHW
Jul 21 '14 at 5:56