Mount namespaces, mount propagation, and unbindable mounts
Mount namespaces, mount propagation, and unbindable mounts
Posted Mar 9, 2017 5:04 UTC (Thu) by prabhunath (guest, #114173)Parent article: Mount namespaces, mount propagation, and unbindable mounts
The above command will work, where the contents of / is visible in /opt/lxc
# mount --bind /opt/lxc /
This will not work. Any reason for this ? Neither this command fails nor the contents of /opt/lxc is visible in /
Posted Mar 9, 2017 10:33 UTC (Thu)
by cortana (subscriber, #24596)
[Link]
$ mkdir /tmp/foo
In a second terminal:
# mount --bind /etc /tmp/foo
In the first terminal, you are still able to interact with the underlying /tmp/foo directory and its contents. Only once you cd out of the mount point does they become inaccessible.
I think you are seeing the same behaviour when you try to mount something over the root directory.
Mount namespaces, mount propagation, and unbindable mounts
$ cd /tmp/foo
$ touch bar
$ ls
