[Lxc-users] Bind mount point must be in container root?
Leonid Isaev
lisaev at umail.iu.edu
Tue Oct 8 17:07:44 UTC 2013
On Tue, 8 Oct 2013 13:20:58 +0300
Kaj Wiik <kaj.wiik at iki.fi> wrote:
> Hi!
>
> I noticed that in order to get bind mount (from host to container)
> work, the mount point must be in container root:
>
> This works:
> lxc.mount.entry = /mnt/raid/course_data course_data none bind 0 0
>
> This does not:
> lxc.mount.entry = /mnt/raid/course_data mnt/course_data none bind 0 0
>
> The files just do not show up, no error messages that I could see are
> emitted...
>
> LXC 0.7.5-3ubuntu67, kernel 3.5.0-41-generic #64~precise1-Ubuntu
>
> Is this expected and documented? Detecting this (and workaround) took
> quite a lot of time...
>
> Cheers,
> Kaj
So, would (mnt with a /) this work?
-----
lxc.mount.entry = /mnt/raid/course_data /mnt/course_data none bind 0 0
-----
I have the following bind mount of the host's LVM partition for samba
server inside an LXC guest (using lxc-0.9.0 on linux 3.11.4):
-----
$ grep "var/lib" /var/lib/lxc/appserver1/config
lxc.rootfs=/var/lib/lxc/appserver1/rootfs
lxc.mount=/var/lib/lxc/appserver1/fstab
$ tail -n1 /var/lib/lxc/appserver1/fstab
/home/smb_nobody /var/lib/lxc/fserv1/rootfs/srv/ftp none defaults,bind
0 0
-----
Cheers,
--
Leonid Isaev
GnuPG key: 0x164B5A6D
Fingerprint: C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20131008/37bb88cd/attachment.pgp>
More information about the lxc-users
mailing list