[Lxc-users] lxc.mount and mount.entry not working

Geordy Korte gkorte at gmail.com
Thu Nov 25 16:29:27 UTC 2010


this one is great.  You can't have the same mount point in the container as
the host.  So mounting /mnt/something in the host and /mnt/something in the
container causes pivot root to umount it.

The thing I did to solve it was to delete the /etc/mtab in the container and
link it to /proc/mounts using a symlink

rm /etc/mtab
ln -s /proc/mounts /etc/mtab


Anyway my mounts now work.

Thanx to all

On Thu, Nov 25, 2010 at 5:14 PM, Christian <cf at cannaweb.ch> wrote:

> Hi,
> i have the same problem before.
> lxc 0.7.3 change the mount directory.
> now is /usr/lib/lxc/rootfs/ for all container. but is not shared with other
> container.
> try lxc.mount.entry=/mnt/1TB-Movies /usr/lib/lxc/rootfs/mnt2/1TB-Movies
>  none   rw,bind 0 0
>
> May be, this is the solution.
>
> greeting, Christian.
> sorry for my bad english.
>
>  Hi,
>>
>> Sorry if I sound like a complete idiot but after spending the last 3 hours
>> trying to figure out why my mounts are not working I have given up. LXC
>> mounts them ( i see this in the logs) en lxc_conf unmounts them (possibly
>> due to pivot_root).
>>
>>  Some background:
>> Host running LXC: Debian squeeze
>> Version of LXC: 0.7.2-1
>>
>> I have create an LXC container using the /usr/lib/lxc/templates/lxc-debian
>> template and this went fine.
>>
>> Now on my host i have a USB disk mounted to /mnt/1TB-Movies and I would
>> like to use it in the LXC container I just created. So I add the following
>> to the lxc config file:
>> lxc.mount.entry=/mnt/1TB-Movies
>> /var/lib/lxc/lxc-file//rootfs/mnt2/1TB-Movies      none   rw,bind 0 0
>>
>> When I now start the LXC container and I set the debugging to DEBUG I
>> notice the following:
>>      lxc-start 1290693817.212 INFO     lxc_conf - cgroup has been setup
>>      lxc-start 1290693817.212 DEBUG    lxc_conf - mounted proc on
>> /var/lib/lxc/lxc-file//rootfs/proc, type proc
>>      lxc-start 1290693817.212 DEBUG    lxc_conf - mounted devpts on
>> /var/lib/lxc/lxc-file//rootfs/dev/pts, type devpts
>>      lxc-start 1290693817.212 DEBUG    lxc_conf - mounted sysfs on
>> /var/lib/lxc/lxc-file//rootfs/sys, type sysfs
>>      lxc-start 1290693817.212 DEBUG    lxc_conf - remounting
>> /mnt/1TB-Movies on /var/lib/lxc/lxc-file//rootfs/mnt2/1TB-Movies to respect
>> bind or remount options
>>      lxc-start 1290693817.212 DEBUG    lxc_conf - mounted /mnt/1TB-Movies
>> on /var/lib/lxc/lxc-file//rootfs/mnt2/1TB-Movies, type none
>>      lxc-start 1290693817.212 INFO     lxc_conf - mount points have been
>> setup
>>      lxc-start 1290693817.212 INFO     lxc_conf - console has been setup
>>      lxc-start 1290693817.212 INFO     lxc_conf - 4 tty(s) has been setup
>>      lxc-start 1290693817.212 DEBUG    lxc_conf - mounted
>> '/var/lib/lxc/lxc-file//rootfs' on '/usr/lib/lxc'
>>      lxc-start 1290693817.212 DEBUG    lxc_conf - created
>> '/usr/lib/lxc/mnt' directory
>>      lxc-start 1290693817.212 DEBUG    lxc_conf - mountpoint for old
>> rootfs is '/usr/lib/lxc/mnt'
>>      lxc-start 1290693817.212 DEBUG    lxc_conf - pivot_root syscall to
>> '/usr/lib/lxc' successful
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted '/mnt/dev/pts'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted '/mnt/dev/shm'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted '/mnt/sys'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted '/mnt/proc'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/lib/init/rw'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted '/mnt/boot'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted '/mnt/cgroup'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/mnt/1TB-Movies'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/mnt/1TB-Timemachine'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/mnt/500GB-TV'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/mnt/old-sdb3'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/var/lib/lxc/lxc-file/rootfs/proc'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/var/lib/lxc/lxc-file/rootfs/dev/pts'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/var/lib/lxc/lxc-file/rootfs/sys'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/var/lib/lxc/lxc-file/rootfs/mnt2/1TB-Movies'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/var/lib/lxc/lxc-file/rootfs/dev/console'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty1'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty2'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty3'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty4'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted
>> '/mnt2/1TB-Movies'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted '/mnt/dev'
>>      lxc-start 1290693817.213 DEBUG    lxc_conf - umounted '/mnt'
>>      lxc-start 1290693817.213 INFO     lxc_conf - pivoted to
>> '/usr/lib/lxc'
>>
>> This basically tells me that pivot_root is umounting the mount I just
>> made.
>>
>> Can anyone help me with this??? I have also tried putting the mount inside
>> the fstab for the container but same problem.
>>
>>
>> --
>> Geordy Korte
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Increase Visibility of Your 3D Game App&  Earn a Chance To Win $500!
>> Tap into the largest installed PC base&  get more eyes on your game by
>> optimizing for Intel(R) Graphics Technology. Get started today with the
>> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
>> http://p.sf.net/sfu/intelisp-dev2dev
>>
>>
>> _______________________________________________
>> Lxc-users mailing list
>> Lxc-users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/lxc-users
>>
>>
>
>


-- 
==============
Geordy Korte
MSN geordy at geordy.nl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20101125/b0c62c08/attachment.html>


More information about the lxc-users mailing list