OpenVZ Forum


Home » General » Support » How to share a folder between containers
How to share a folder between containers [message #42129] Wed, 02 March 2011 20:38 Go to next message
Tipika is currently offline  Tipika
Messages: 3
Registered: March 2011
Junior Member
I want to share a directory from an OpenVZ container to another container, how I could do that?

1. do a symlink from /vz/private/109/common-stuff to /vz/private/108/common-stuff ?
2. bind mount /vz/private/109/common-stuff to /vz/root/108/common-stuff ?
3. Share the directory with samba from the container, mount on the host, then bind mount to /vz/root/108/common-stuff ?
Re: How to share a folder between containers [message #42168 is a reply to message #42129] Mon, 14 March 2011 13:00 Go to previous message
hybrid512 is currently offline  hybrid512
Messages: 4
Registered: December 2010
Location: France
Junior Member
Easiest and best way to do this is to do like this :
- create some folder on your host filesystem
- bind this folder in your containers

To do that, the best way is to create a <CTID>.mount in your /etc/vz/conf directory which will look like this :

============================================================ ===
#!/bin/bash

source /etc/vz/vz.conf
source ${VE_CONFFILE}

mount -n --bind /common-stuff ${VE_ROOT}/common-stuff

============================================================ ===

Off course, /common-stuff must exist in your container but with this, /common-stuff will be automatically binded when you start your container.

Regards,

Previous Topic: Kernel Panic on vzctl stop
Next Topic: Bind IPs?
Goto Forum:
  


Current Time: Mon Nov 18 17:32:18 GMT 2024

Total time taken to generate the page: 0.02926 seconds