<div dir="ltr"><div><div><div><div><div>Thanks, <br>seem to work only for sharepoint within / mounted as ext4<br></div>doesnt seem to work if the shared folder is inside of a tmpfs ( ad hoc created /tmp etc., )<br><br><br>
container1.conf : added entry for /mnt  [ lxc.mount.entry = /mnt /container1/rootfs/mnt none rw,rbind 0 0 ]<br>container2.conf : added entry for /mnt [ lxc.mount.entry = /mnt /container2/rootfs/mnt none rw,rbind 0 0 ]<br>
<br>works :<br>  mkdir -p /mnt<br>  chmod 777 -R /mnt<br>  mkdir -p /media<br>  mount --make-rbind /media /media<br>  mount --make-rshared /media<br>  mount --make-rbind /media /mnt<br>  mount --make-rslave /mnt<br><br><br>
container1.conf : added entry for /mnt pointing to  /tmp/mnt  [  lxc.mount.entry = /tmp/mnt /container1/rootfs/mnt none rw,rbind 0 0 ]<br>container2.conf : added entry for /mnt pointing to  /tmp/mnt<br><br></div><div>doesnt work:<br>
mount -t tmpfs -o mode=01777 tmpfs /tmp<br>  mkdir -p /tmp/mnt<br>  chmod 777 -R /tmp/mnt<br>  mkdir -p /tmp/media<br>  mount --make-rbind /tmp/media /tmp/media<br>  mount --make-rshared /tmp/media<br>  mount --make-rbind /tmp/media /tmp/mnt<br>
  mount --make-rslave /tmp/mnt<br></div><div><br>container-2 still unmounts /tmp/mnt<br><br></div></div>what ever container1 mounts in /mnt is visible on container2<br><br></div>found a thread where entry in fstab matters?<br>
<br></div><div>Thanks.<br></div><div><div><div><div><div><div><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 4, 2014 at 11:36 AM, Serge Hallyn <span dir="ltr"><<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Quoting Vijay Viswanathan (<a href="mailto:vijay.vishy@gmail.com">vijay.vishy@gmail.com</a>):<br>

> Hi<br>
> Is there an option where shared mount works and restrict propogation of<br>
> unmounts ?<br>
><br>
> This the sequence to reproduce the issue.<br>
> 1) make /mnt share mount<br>
> 2) mount a usb stick on it /dev/sdc -> /mnt/usb<br>
>              [here mount shows : /dev/sdc on /mnt/usb type ... ]<br>
> 3) Now start a container that has the mount entry for /mnt<br>
> [e.g., lxc.mount.entry = /mnt /home/otvlxc/rootfs/mnt none rw,bind 0 0 ]<br>
><br>
> what I see is :<br>
> lxc-start      73733.655 DEBUG    lxc_conf - umounted<br>
> '/myvm1_putold/mnt/usb'<br>
> /mnt/usb is gone from the host also :(<br>
><br>
><br>
> The reason I want to make /mnt shared is that to share a mount point that<br>
> is mounted by one vm ( not just mounts done by host) be available on<br>
> another vm any suggestions towards this is fine too.<br>
><br>
> Any tips and tricks ?<br>
<br>
</div></div>You can't separate umounts from mounts.  However you can do a step<br>
better than what you have.  You want to have slave semantics from<br>
the host to another directory, then share from that to all<br>
containers.  That way, mounts on your host will be seen in the<br>
containers, but umounts in the containers won't be seen on the<br>
host.  Mounts done in one container will be seen in the others,<br>
however umounts will as well.<br>
<br>
-serge<br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
</blockquote></div><br></div>