[Lxc-users] Slow and unexpected umounts after pivot_root

Daniel Lezcano daniel.lezcano at free.fr
Tue Mar 1 10:37:13 UTC 2011


On 03/01/2011 10:57 AM, David Serrano wrote:
> Hi,
>
> During the containers startup, I'm having an issue when LXC performs
> the pivot_root operation and then goes on to umount some directories.
> When looked for that on google and saw other people's logs, I found
> that this procedure usually performs very quickly, while in my case it
> only does about 4 umounts per second.

Thanks David for the detailed information.
The kernel 2.6.32-24 has a regression with the umount I think.

I recommend you install a more recent kernel version, you will find more 
informations at:

https://lists.ubuntu.com/archives/kernel-team/2010-July/011680.html

[ ... ]

> ## these are done only once
> mount -t nfs -o ro host:/dir nfsroot/
> mount -o bind/lib/modules/$(uname -r) nfsroot/lib/modules/$(uname -r)
>
> ## these are done every time this container is started and undone upon
> container exit
> mount -o loop ovl00.ext4 /var/lib/lxc/testimg00/ovl00
> mount -t aufs -o br:/var/lib/lxc/testimg00/ovl00:nfsroot=ro aufs
> /var/lib/lxc/testimg00/root00
> mount -t aufs -o br:/var/lib/lxc/testimg00/ovl00/lib/modules/$(uname
> -r):nfsroot/lib/modules/$(uname -r)=ro aufs
> /var/lib/lxc/testimg00/root00/lib/modules/$(uname -r)

[ ... ]

> This setup works as expected but I can see a couple of unexpected
> messages in the log of the second container (testimg01). This is the
> log of the first one. Notice how long it takes to umount all the stuff
> after the pivot_root:
>
>
> In this second log, there are two lines that surprise me:
>
>        lxc-start 1298972574.493 DEBUG    lxc_conf - umounted
> '/.pivot/var/lib/lxc/testimg00/ovl00'
>        lxc-start 1298972574.973 DEBUG    lxc_conf - umounted
> '/.pivot/var/lib/lxc/testimg00/root00/lib/modules/2.6.32-24-server'
>
> Why has LXC to umount these directories? They belong to another
> container so I understand they shouldn't appear here at all.

If I understood correctly, you mount these directories before lxc-start, 
right ?
When the container is launched, the mounts points are inherited and 
appear in the pivot_root, so they are unmounted.





More information about the lxc-users mailing list