Link to home
Start Free TrialLog in
Avatar of CMDAI
CMDAI

asked on

Create a shared or virtual folder in linux

Not sure if its called shared or virtual folder here is what i have

I have a folder which stores thousands of images on domain1  
to simplify updates i want to create a "Shared Folder" in domain2 ,domain3 etc...





/var/www/vhosts/domain1.com/httpdocs/images <- real folder
/var/www/vhosts/domain2.com/httpdocs/images <- is actually ../domain1.com/httpdocs/images
/var/www/vhosts/domain3.com/httpdocs/images <- is actually ../domain1.com/httpdocs/images
/var/www/vhosts/domain4.com/httpdocs/images <- is actually ../domain1.com/httpdocs/images

PS.Domain 2,3 & 4 only need readonly access so it doesn't matter if writing isn't allowed

how can i do this in if i only have ssh connection,
my linux skills are not very good ;)
Avatar of cjl7
cjl7
Flag of Sweden image

Hi,
Here is a step-by-step howto on SSH-FS (filesystem over ssh)

http://www.cyberciti.biz/tips/rhel-centos-mounting-remote-filesystem-using-sshfs.html

//j
Avatar of CMDAI
CMDAI

ASKER

thanks for you reply,
that would be mounting in  a way of mounting a simpler interference for me to use,
i can try it that way but the document seems to out of date case it give me error 404 Not Found
"http://superb-west.dl.sourceforge.net/sourceforge/fuse/fuse-2.6.5.tar.gz""

Either you build them from source or try this page: http://packages.sw.be/fuse-sshfs/


Avatar of CMDAI

ASKER

could i do this without addins? cas i really make amendments to the server no more the once or twice a year.
Nope.

The only other way is to mount it with an existing network filesystem and that leaves you with NFS.

It would do the job, but you stated that only ssh access is possible.

Avatar of CMDAI

ASKER

sorry one more question i have samba installed can use it instead?
Avatar of CMDAI

ASKER

anyway i installed it trying to configure now
Avatar of CMDAI

ASKER

i think i got everything installed now trying to mount but with no success, are my commands wrong?

sshfs /var/www/vhosts/domain1.com/httpdocs/images: /var/www/vhosts/domain2.com/httpdocs/imagesvirtual

reply is:
read: Connection reset by peer

Open in new window

Yes, but samba isn't ssh...

If you consider using samba I suggest NFS instead. It's more "linux-native" and is already installed on your boxes...

//jonas
Avatar of CMDAI

ASKER

Connection reset by peer <- no idea what this means
Avatar of CMDAI

ASKER

To test i tried to unmount it sais that directory is not mounted
SOLUTION
Avatar of svs
svs
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CMDAI

ASKER

"mount --bind" is much more suited for this task than sshfs, nfs or samba.
Thanks alot work great,
how to unmount?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CMDAI

ASKER

so whats the difference between `mount` and `in` ?
ln will do exactly what you want, mount --bind will be a bit trickier to handle and is not needed in this case (IMO).
Avatar of CMDAI

ASKER

Thank you got it working