http://www.linux-vserver.org/api.php?action=feedcontributions&user=212.200.52.11&feedformat=atomLinux-VServer - User contributions [en]2024-03-19T08:36:25ZUser contributionsMediaWiki 1.20.2http://www.linux-vserver.org/Share_a_directory_among_multiple_guestsShare a directory among multiple guests2007-11-21T14:49:03Z<p>212.200.52.11: note restart need for runnning vservers</p>
<hr />
<div>How to share a directory, such as <code>/home</code>, among multiple vserver guests.<br />
__TOC__<br />
== Assumptions ==<br />
Suppose you have multiple vserver guests at locations such as <code>/var/lib/vservers/<guest>/</code>.<br />
You would like to share a directory, such as <code>/srv/common/home</code>, among multiple guests.<br />
Each guest will be able to write to the directory.<br />
<br />
== Command ==<br />
The following command will mount this directory for all guests:<br />
$ for guest in /var/lib/vservers/*; do mount --bind /srv/common/home ${guest}/home; done<br />
<br />
Note that you might have to (re)start your vserver AFTER the mount for the shared path to be visible under it.<br />
<br />
== fstab ==<br />
Alternatively, you may add an entry similar to the below one in <code>/etc/vservers/<guest>/fstab</code>:<br />
/srv/common/home /home none bind 0 0<br />
<br />
== See also ==<br />
* <code>$ man mount</code></div>212.200.52.11