Hi,
The following scenario without OpenVZ:
# mount /dev/sda1 /home
# mount --bind /home /dest1
# mount --bind /home /dest2
...
Now the content from /home is mapped to dest1 and dest2. Now I want to unmount these mapping but never ever the original mount to /home:
# umount /dest1
# umound /dest2
...
# ls /home
(there are files)
Well this is how should bind-mounts work. Now OpenVZ comes into play. In $VEID.mount, I have the following command:
mount --bind /home /var/lib/vz/root/${VEID}/home
When the VE starts everything is fine. In the $VEID.unmount-Skript I have the following command:
umount /home /var/lib/vz/root/${VEID}/home
But now suddenly /home has been unmounted too on the host!! But this should never ever happen!
When I just ignore unmounting the bind-mounts it seems to work without problems but it seems to be not elegant to me.
I just don't understand it. Without the mount-Scripts everything works fine. But inside the mount/umount script, the original mount (/dev/sda1 to /home on VE0) is unmounted too.
And this is a fiasco: I have mounted /home into multiple VEs stopping one VE which has /home mounted removes /home from all other VEs!
Does anybody know something about this issue?
Regards,
divB