[Lxc-users] Bind mounts not working (not visible) in container

Ryan Campbell ryan.campbell at gmail.com
Sat Jan 8 00:22:26 UTC 2011


After posting this, I thought to change the mount point which solved
my problem.  I think the issue was I put the mount point under
/mnt/master2 (moving it to /master2 worked)

Why would putting my mount under /mnt prevent it from being seen by
the container?

On Fri, Jan 7, 2011 at 6:04 PM, Ryan Campbell <ryan.campbell at gmail.com> wrote:
> I've specified a bind mount for my container in my lxc.conf, but I
> don't see it in my container's /proc/mounts.  This is the mount.entry
> from my lxc.conf:
>
> lxc.mount.entry = /tmp/foo /var/lib/lxc/rootfs/default/mnt/master2 none bind 0 0
>
> (full lxc.conf: https://gist.github.com/ef745c03d5502e601b2b)
>
> But when I start the container, I don't see the mount available in
> /proc/mounts inside the container. However, if I start the container
> using lxc-start -l DEBUG, it looks as though the mount is respected,
> it just gets umounted by the pivot_root call:
>
> <snip>
>      lxc-start 1294442491.758 DEBUG    lxc_conf - remounting /tmp/foo
> on /var/lib/lxc/rootfs/default/mnt/master2 to respect bind or remount
> options
>      lxc-start 1294442491.758 DEBUG    lxc_conf - mounted /tmp/foo on
> /var/lib/lxc/rootfs/default/mnt/master2, type none
> <snip>
>      lxc-start 1294442491.759 DEBUG    lxc_conf - pivot_root syscall
> to '/usr/lib/lxc/rootfs' successful
> <snip>
>      lxc-start 1294442491.861 DEBUG    lxc_conf - umounted '/mnt'
>      lxc-start 1294442491.861 DEBUG    lxc_conf - umounted '/mnt/master2'
>      lxc-start 1294442491.861 INFO     lxc_conf - pivoted to
> '/usr/lib/lxc/rootfs'
>
> full log: https://gist.github.com/c1bbe13660c944b64ce2
>
> I'm using lxc 0.7.2 that came packaged on Fedora 13.  I used this
> script to create the container:
> https://gist.github.com/0435aacdd8eb3ca88bb0
>
> How can a simple bind mount such as this to work in lxc?
>
> Thanks,
> Ryan
>




More information about the lxc-users mailing list