Skip to contentSkip to conversation

Adding a mount after container is running?

DISCUSSION Michael Tokarev 1 participant 1 message Nov 3, 2010

lore
Share & tools
lore
#0 lore raw

Hello.

What is the way to add a new filesystem mount to an already running container? I want to "propagate" a newly created filesystem, or another part of host filesystem, to a container without restarting it.

I can imagine a way to "propagate" a new filesystem - by (maybe temporarily) granting access for the block device in question to the container and doing a real mount from there. I'm not sure if it's equivalent to a bind-mount in terms of resulting behavour (I sent this question to lkml a few mins ago), but at least this is easily doable.

But if I want to add a part of existing filesystem tree to my container, things becomes somewhat less clean. Still doable in a similar way - by mounting it in container in a temp place, bind-mounting a needed part to the right place, and umounting the temp one. But it's not clean ;)

Is there a better way?

Thanks!

/mjt