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

2010-11-25 Thread Geordy Korte
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 DEBUGlxc_conf - mounted proc on
/var/lib/lxc/lxc-file//rootfs/proc, type proc
  lxc-start 1290693817.212 DEBUGlxc_conf - mounted devpts on
/var/lib/lxc/lxc-file//rootfs/dev/pts, type devpts
  lxc-start 1290693817.212 DEBUGlxc_conf - mounted sysfs on
/var/lib/lxc/lxc-file//rootfs/sys, type sysfs
  lxc-start 1290693817.212 DEBUGlxc_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 DEBUGlxc_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 DEBUGlxc_conf - mounted
'/var/lib/lxc/lxc-file//rootfs' on '/usr/lib/lxc'
  lxc-start 1290693817.212 DEBUGlxc_conf - created
'/usr/lib/lxc/mnt' directory
  lxc-start 1290693817.212 DEBUGlxc_conf - mountpoint for old rootfs
is '/usr/lib/lxc/mnt'
  lxc-start 1290693817.212 DEBUGlxc_conf - pivot_root syscall to
'/usr/lib/lxc' successful
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/dev/pts'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/dev/shm'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/sys'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/proc'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/lib/init/rw'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/boot'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/cgroup'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/mnt/1TB-Movies'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/mnt/1TB-Timemachine'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/mnt/500GB-TV'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/mnt/old-sdb3'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/var/lib/lxc/lxc-file/rootfs/proc'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/var/lib/lxc/lxc-file/rootfs/dev/pts'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/var/lib/lxc/lxc-file/rootfs/sys'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/var/lib/lxc/lxc-file/rootfs/mnt2/1TB-Movies'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/var/lib/lxc/lxc-file/rootfs/dev/console'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty1'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty2'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty3'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty4'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted
'/mnt2/1TB-Movies'
  lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/dev'
  lxc-start 1290693817.213 DEBUGlxc_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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


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

2010-11-25 Thread Serge Hallyn
Quoting Geordy Korte (gko...@gmail.com):
 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.

Have you entered the container to verify?  I would have guessed that
the unmounting is just a part of unmounting the *old* fs tree.

You have /var/lib/lxc, under which is the container's rootfs, and the
debug tells you that the original / is left under /var/lib/lxc/mnt.
Meaning that after the pivot_root, you have '/' as the container's
root (the old /var/lib/lxc), and '/mnt' containing the old '/'.  Now
lxc recursively unmounts /mnt.  It's just a part of the pivot_root
procedure.  (see man 8 pivot_root)

--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


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

2010-11-25 Thread Christian
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 DEBUGlxc_conf - mounted proc on 
 /var/lib/lxc/lxc-file//rootfs/proc, type proc
   lxc-start 1290693817.212 DEBUGlxc_conf - mounted devpts on 
 /var/lib/lxc/lxc-file//rootfs/dev/pts, type devpts
   lxc-start 1290693817.212 DEBUGlxc_conf - mounted sysfs on 
 /var/lib/lxc/lxc-file//rootfs/sys, type sysfs
   lxc-start 1290693817.212 DEBUGlxc_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 DEBUGlxc_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 DEBUGlxc_conf - mounted 
 '/var/lib/lxc/lxc-file//rootfs' on '/usr/lib/lxc'
   lxc-start 1290693817.212 DEBUGlxc_conf - created 
 '/usr/lib/lxc/mnt' directory
   lxc-start 1290693817.212 DEBUGlxc_conf - mountpoint for old 
 rootfs is '/usr/lib/lxc/mnt'
   lxc-start 1290693817.212 DEBUGlxc_conf - pivot_root syscall 
 to '/usr/lib/lxc' successful
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/dev/pts'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/dev/shm'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/sys'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/proc'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/lib/init/rw'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/boot'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/cgroup'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/mnt/1TB-Movies'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/mnt/1TB-Timemachine'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/mnt/500GB-TV'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/mnt/old-sdb3'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/var/lib/lxc/lxc-file/rootfs/proc'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/var/lib/lxc/lxc-file/rootfs/dev/pts'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/var/lib/lxc/lxc-file/rootfs/sys'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/var/lib/lxc/lxc-file/rootfs/mnt2/1TB-Movies'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/var/lib/lxc/lxc-file/rootfs/dev/console'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty1'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty2'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty3'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt/var/lib/lxc/lxc-file/rootfs/dev/tty4'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted 
 '/mnt2/1TB-Movies'
   lxc-start 1290693817.213 DEBUGlxc_conf - umounted '/mnt/dev'
   lxc-start 1290693817.213 DEBUGlxc_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