Re: [Lxc-users] how to mount inside of running container
Hi, Thank you for the instructions, but looks I did something wrong. If I create files on the /shared/containerX, they appear properly in the container's /shared directory. If I create a directory in the /shared/containerX directory and mount some other partition onto that /shared/containerX/an_partition directory, the partition's content appear empty inside of the container. It shows properly though on the host machine. Aren't --make-rshared and --make-rslave counterexclusive? -- Arie On Wed, Sep 21, 2011 at 20:26, Serge E. Hallyn serge.hal...@canonical.com wrote: Quoting Arie Skliarouk (sklia...@gmail.com): I want to bind-mount an directory inside of a running container. If I mount the directory using bind mount, the container does not see files in it. It is important to me to be able to do the mounts and umounts from the host machine, as we are dealing with LVM snapshots. If it's ok to do it ahead of time, then you can use mount entries in your config file. If you want to be able to just manually run the mount command from the host at any time, then you'll need to create a directory for the sharing and mount that into your container ahead of time. For instance, mkdir /share/containerX mkdir /var/lib/lxc/containerX/rootfs/share mount -t tmpfs share /share/containerX mount --make-rshared /share/containerX mount --make-rslave /share/containerX cat /var/lib/lxc/containerX/fstab EOF /share/containerX /var/lib/lxc/containerX/rootfs/share none bind 0 0 EOF lxc-start -n containerX -d Now when you mount something under /share/containerX, it will show up under /share in the container. I.e. -serge -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] how to mount inside of running container
Quoting Arie Skliarouk (sklia...@gmail.com): Hi, Thank you for the instructions, but looks I did something wrong. Sorry, no, my instructions weren't quite right. I'm going to spend a bit of time right now whipping up some tested directions, and will get back to you. -serge -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] how to mount inside of running container
Quoting Serge Hallyn (serge.hal...@canonical.com): Quoting Arie Skliarouk (sklia...@gmail.com): Hi, Thank you for the instructions, but looks I did something wrong. Sorry, no, my instructions weren't quite right. I'm going to spend a bit of time right now whipping up some tested directions, and will get back to you. -serge I see you fixed it for yourself, but fwiw: http://s3hh.wordpress.com/2011/09/22/sharing-mounts-with-a-container/ -serge -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] how to mount inside of running container
It is weirder than that. The partition bind-mounted under /share/containerX/an_partition is not unmounted on guest stop, but unmounted on the guest start. If I run mount /share/containerX/an_partition on the host, only then the partition's content becomes visible on the guest. The /share/containerX partition is not unmounted, it is visible on both host and guest all the time. -- Arie The only problem remains is that the partitions mounted under /share are unmounted the moment the container is shut down. Is there a clean way to avoid that? Hm, turning it into a slave should prevent that. -serge -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] how to mount inside of running container
Quoting Arie Skliarouk (sklia...@gmail.com): I want to bind-mount an directory inside of a running container. If I mount the directory using bind mount, the container does not see files in it. It is important to me to be able to do the mounts and umounts from the host machine, as we are dealing with LVM snapshots. If it's ok to do it ahead of time, then you can use mount entries in your config file. If you want to be able to just manually run the mount command from the host at any time, then you'll need to create a directory for the sharing and mount that into your container ahead of time. For instance, mkdir /share/containerX mkdir /var/lib/lxc/containerX/rootfs/share mount -t tmpfs share /share/containerX mount --make-rshared /share/containerX mount --make-rslave /share/containerX cat /var/lib/lxc/containerX/fstab EOF /share/containerX /var/lib/lxc/containerX/rootfs/share none bind 0 0 EOF lxc-start -n containerX -d Now when you mount something under /share/containerX, it will show up under /share in the container. I.e. -serge -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users