Re: [lxc-users] Mounts in shared folder not seen in container
Thanks it's working! I had tried rbind but in the command line. I did not know it was possible to have it in the config. I will go ask on Libvirt mailing list, because I was trying to get that using libvirt-lxc, and there does not seem to exist an equivalent option. 2015-10-05 17:11 GMT+02:00 Serge Hallyn: > Quoting Bertrand NOEL (bertrand.noel...@gmail.com): >> Hi, >> I share a folder from host to container. That folder contains mounts. >> Below is a simple usecase of what I do. >> >> # On host >> mkdir -p /shared/mount1 >> mount some.iso /shared/mount1 >> >> # In the config of my container >> lxc.mount.entry = /shared shared none bind 0 0 >> >> # On the host >> tree /shared >> /shared/ >> └── mount1 >> └── file >> >> # On the container >> tree /shared >> /shared/ >> └── mount1 >> >> I do see the folder and the subfolders, but not the contents of the mounts. >> Is it expected behaviour? How can I share a folder containing mounts? >> >> If I share the mount directly, and not its containing folder >> (lxc.mount.entry = /shared/mount1 shared/mount1 none bind 0 0), it >> works - I can see the files. >> But I have lots of mount points, and they could change. >> >> I have read that webpage [1] and discussions on this mailing list [2] >> about sharing mounts. It works, but only for mounts mounted *after* >> the container has started. > > You want rbind (recursive bind), just bind is only the mount itself. > ___ > lxc-users mailing list > lxc-users@lists.linuxcontainers.org > http://lists.linuxcontainers.org/listinfo/lxc-users ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
[lxc-users] Mounts in shared folder not seen in container
Hi, I share a folder from host to container. That folder contains mounts. Below is a simple usecase of what I do. # On host mkdir -p /shared/mount1 mount some.iso /shared/mount1 # In the config of my container lxc.mount.entry = /shared shared none bind 0 0 # On the host tree /shared /shared/ └── mount1 └── file # On the container tree /shared /shared/ └── mount1 I do see the folder and the subfolders, but not the contents of the mounts. Is it expected behaviour? How can I share a folder containing mounts? If I share the mount directly, and not its containing folder (lxc.mount.entry = /shared/mount1 shared/mount1 none bind 0 0), it works - I can see the files. But I have lots of mount points, and they could change. I have read that webpage [1] and discussions on this mailing list [2] about sharing mounts. It works, but only for mounts mounted *after* the container has started. System is Ubuntu 14.04.3, with LXC 1.0.7 [1] https://s3hh.wordpress.com/2011/09/22/sharing-mounts-with-a-container/ [2] https://lists.linuxcontainers.org/pipermail/lxc-users/2014-February/006168.html [2] https://lists.linuxcontainers.org/pipermail/lxc-users/2014-March/006337.html ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Mounts in shared folder not seen in container
Quoting Bertrand NOEL (bertrand.noel...@gmail.com): > Hi, > I share a folder from host to container. That folder contains mounts. > Below is a simple usecase of what I do. > > # On host > mkdir -p /shared/mount1 > mount some.iso /shared/mount1 > > # In the config of my container > lxc.mount.entry = /shared shared none bind 0 0 > > # On the host > tree /shared > /shared/ > └── mount1 > └── file > > # On the container > tree /shared > /shared/ > └── mount1 > > I do see the folder and the subfolders, but not the contents of the mounts. > Is it expected behaviour? How can I share a folder containing mounts? > > If I share the mount directly, and not its containing folder > (lxc.mount.entry = /shared/mount1 shared/mount1 none bind 0 0), it > works - I can see the files. > But I have lots of mount points, and they could change. > > I have read that webpage [1] and discussions on this mailing list [2] > about sharing mounts. It works, but only for mounts mounted *after* > the container has started. You want rbind (recursive bind), just bind is only the mount itself. ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users