mount --bind replicates a mount at another location. For example, after
mount --bind /foo /bar
/bar/something are the same file (accessed through different paths). You can use
mount --bind to replicate a subtree:
/foo doesn't have to be a mount point.
An example where this is useful is to make parts of the directory tree available under a chroot. For example, if you run a web server chrooted in
/srv, but you want to serve files under
/home/bob, then you can replicate (part of) Bob's home directory under the server root:
mount --bind /home/bob/public_html /srv/home/bob
--make-unbindable provide some control over bind mounts and over what happens if you mount another filesystem under
/bar after doing
mount --bind /foo /bar.
- By default, all mounts are private: if you mount a filesystem under
/bar, this doesn't affect what is visible through the other path.
/foo has been declared shared before doing
mount --bind, then if you later mount something either under
/bar, it's visible through the other path as well.
- A slave mount is shared only in one direction: if
/foo is shared and
/bar is slave, then mounting something under
/bar affects the view under
/foo but the converse is not true.
/foo is declared unbindable, then
mount --bind /foo /bar will fail.