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

Geordy Korte gkorte at gmail.com
Sat Jan 8 07:41:02 UTC 2011


Had the same problem a while back. If you have your mounts mounted on your host is mnt and attempt to create an mnt in our rootfs then pivot will remove it. Rename it to mnt2 and no pbs.

Mvg

Geordy Korte
(Sent via iphone so shorter then normal)


On 8 jan. 2011, at 01:22, Ryan Campbell <ryan.campbell at gmail.com> wrote:

> 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
>> 
> 
> ------------------------------------------------------------------------------
> Gaining the trust of online customers is vital for the success of any company
> that requires sensitive data to be transmitted over the Web.   Learn how to 
> best implement a security strategy that keeps consumers' information secure 
> and instills the confidence they need to proceed with transactions.
> http://p.sf.net/sfu/oracle-sfdevnl 
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users




More information about the lxc-users mailing list