<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><span style="font-family:arial,sans-serif;font-size:13px">Hi All</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I have 2 lxc-containers (cap_a and cap_b) which are backed by 2 separate logical volumes (lv_a and lv_b)</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">The logical volumes are mounted at /capsule_mnt/cap_a and /capsule_mnt/cap_b for containers cap_a and cap_b respectively.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">For sharing from the host side, I have bind mounted /shared/<container_name> for each of the above containers. For each of the containers, I am attempting to access mount points  which are mounted from the host side and can be accessed from the shared mounted directory of each container.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I was following the instructions mentioned in the following discussion to ensure that the startup of the second container does not blow up the mount points of the first container.</div><div style="font-family:arial,sans-serif;font-size:13px"><a href="https://lists.linuxcontainers.org/pipermail/lxc-users/2012-February/003187.html" target="_blank">https://lists.linuxcontainers.org/pipermail/lxc-users/2012-February/003187.html</a><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Everything works fine as per the instructions mentioned in the above thread. However, when I try to delete the first container (while the second container is still up), I get the following error:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">root@dev2:~# lxc-stop -n cap_a<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">root@dev2:~# mount | grep cap<br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>/dev/mapper/vg_1-lv_a on /capsule_mnt/cap_a type ext4 (rw)</div><div>/dev/mapper/vg_1-lv_b on /capsule_mnt/cap_b type ext4 (rw)</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">root@dev2:~# umount /capsule_mnt/cap_a<br></div><div style="font-family:arial,sans-serif;font-size:13px">root@dev2:~# umount /capsule_mnt/cap_a<br></div><div style="font-family:arial,sans-serif;font-size:13px">/dev/mapper/vg_1-lv_b on /capsule_mnt/cap_b type ext4 (rw)<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>root@dev2:~# lxc-destroy -n cap_a</div><div>lxc_container: _recursive_rmdir_onedev: failed to delete /capsule_mnt/cap_a/</div><div>lxc_container: Error destroying rootfs for cap_a</div><div>Destroying cap_a failed</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>root@dev2:~# lvremove /dev/vg_1/lv_a</div><div>  Logical volume vg_1/lv_a contains a filesystem in use.</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Does anyone have an idea as to why this might be happening? It probably has something to do with mounting the /shared directory as "rslave" before starting each of the container.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I also observed that the container (cap_a) destroy and deletion of the logical volume lv_a works fine once the second container (cap_b) is either stopped or destroyed.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Any suggestion as to how I can get past this issue would be very useful.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks,</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">-Shivraj</div></div></div>