[lxc-devel] Strange problem (stray mounts) with lxc-create...

Michael H. Warfield mhw at WittsEnd.com
Mon Oct 14 21:34:38 UTC 2013


On Wed, 2013-10-09 at 09:50 -0500, Serge Hallyn wrote: 
> > lxc-create -n Ubuntu-test -t ubuntu
> > 
> > Bingo...
> > 
> > /dev/mapper/fedora-root on /usr/lib64/lxc/rootfs type ext4 (rw,relatime,seclabel,data=ordered)
> > 
> > Why is lxc-create even creating that mount?  I don't see any reason for
> 
> Check lxccontainer.c:785 and line 805.  We call bdev_mount() in case its
> a blockdev.  In the case of a dir-backed container we still end up doing
> a bind mount of the rootfs.

I'm not seeing the first of those ERROR calls show up in the output.
The second one is a strange bird...

I never see this one hit:

ERROR("error unsharing mounts");

I DO, however, see this message (assuming it's a unique message that may
not be duplicated in other messages):

ERROR("Error mounting rootfs");

However, that appears to only occur if I tried to create a previous
container under the same name and that failed (and then I have a
dangling mount that seems to generate the failure).  I can reproduce
that error by creating a container under a name "Foo" and then
immediately destroying it and then attempting to create a new one with
the same name (without running the umounts first).  Then I see that
"Error mounting rootfs" until I run the umount command first.

> > it.  We're never running the container in lxc-create.  Running
> > "umount /usr/lib64/lxc/rootfs" clears it and we're off to the races
> > again.
> > 
> > If I were to venture a WAG (Wild Ass Guess) some initialization code is
> > creating that bind mount that is not needed and that the cleanup code in
> > lxc-create is unaware of.  But I haven't gone to the trouble of trying
> > to track the code down yet.
> 
> Now is your / still MS_SHARED?  The bdev create and templates
> run in a private namespace, but if MS_SHARED then the mounts get
> bounced back to host.  Maybe we need to manually set MS_PRIVATE every
> time after doing an unshare() in lxc code.
> 

-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20131014/fabc71fc/attachment.pgp>


More information about the lxc-devel mailing list