[Lxc-users] mount from outside of a container online
C Anthony Risinger
anthony at xtfx.me
Tue Jul 19 00:43:10 UTC 2011
On Jul 18, 2011 2:58 PM, "Serge E. Hallyn" <serge.hallyn at canonical.com>
wrote:
>
> Quoting Papp Tamas (tompos at martos.bme.hu):
> > On 2011-07-18 15:14, Serge E. Hallyn wrote:
> > > It should be possible, but you have to set it up in advance. You can
> > > create a /lxcshare directory on the host, make sure it is slave
> > > (mount --make-rslave /lxcshare) and bind-mount that into the container
> > > at startup. Then mounting a directory into /lxcshare should expose it
> > > to the container.
> > >
> >
> > helo!
> >
> > Thank you for you answer, Serge:)
> >
> > I'm not sure I correctly unserstand this part of manual, but I'm sure,
> > this is not exactly I want.
> > I wanted (and also want to do it in the future) to mount a directory as
> > 'adhoc', without restarting the container.
>
> I don't think that's possible. But note that the setup I'm proposing
> only needs to be done once at container creation, and could be supported
> in templates.
>
> Once set up, usage would be:
>
> host admin:
>
> mkdir /lxcshare/cdrom
> mount /dev/cdrom /lxcshare/cdrom
>
> container admin:
> mount --move /lxcshare/cdrom /mnt/cdrom
You'd also need to --make-shared the host mount before --bind'ing and
--make-slave'ing to the container ... by default mounts are --private.
C Anthony [mobile]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20110718/f0d7f8f3/attachment.html>
More information about the lxc-users
mailing list