[systemd-devel] Possible to add bind mounts without rebooting container?

Lennart Poettering lennart at poettering.net
Sat Oct 11 15:09:16 PDT 2014


On Mon, 15.09.14 11:16, Leho Kraav (leho at kraav.com) wrote:

> We're currently running systemd-212. man doesn't seem to cover this.
> 
>        --bind=, --bind-ro=
>            Bind mount a file or directory from the host into the container.
> Either takes a path argument -- in which case the specified path will be
> mounted from the host to the same path in the container --, or a
> colon-separated pair of paths -- in which case the first specified path is
> the source in the host, and the second path is the destination in the
> container. The --bind-ro= option creates read-only bind mounts.
> 
> Hoping to avoid rebooting the container.

What precisely are you trying to do? If you want to mount a dir into
the container's tree from the outside this should just work by
mounting thingsnormally with /bin/mount on the host. This will then be
propagated into the container. However, this only works for stuff
outside of /run, /proc and all that other virtual dirs of the
container that are not visible on the host.

Note that propagation of mounts+unmounts should just work from the
host into the container, but not in the other direction.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list