[lxc-users] debian jessie && ro bind mounts...

Marco foobar.angus at gmail.com
Tue Mar 10 12:43:59 UTC 2015


Hi,
I'm experiencing issues while trying to share an host path or filesystem as
read only to guests (read only bind-mounts).

Host: Debian 8 Jessie
Linux deb 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt4-3 (2015-02-03) x86_64
GNU/Linux

LXC: stock, 1.0.6-6
Guest: Debian 8 (no systemd)
Filesystem on host: ext4

I'm sharing the host:
- /system
by using a custom entry in fstab-like file loaded via the container config
file, i.e.:
/system system none ro,bind,create=dir 0 0

NB: as my "/system" path I've tested a subdirectory and even a mount point.
And I've also dome some tests by using an entry in the config file with
lxc.mount.entry, but with the same issues.

Well, the guest correctly bind-mounts the host path, but mounts it as
read-write.
By simply issuing on the guest:
mount -o remount,ro /system
does the job... but ... as I understood it has to work out of the box.

An excerpt of the log obtained while starting the guest:
      lxc-start 1425989871.658 DEBUG    lxc_conf - remounting /system on
/usr/lib/x86_64-linux-gnu/lxc/rootfs/system to respect bind or remount
options
      lxc-start 1425989871.658 DEBUG    lxc_conf - (at remount) flags for
/system was 4096, required extra flags are 0
      lxc-start 1425989871.658 DEBUG    lxc_conf - mountflags already was
4097, skipping remount
      lxc-start 1425989871.658 DEBUG    lxc_conf - mounted '/system' on
'/usr/lib/x86_64-linux-gnu/lxc/rootfs/system', type 'none'
      lxc-start 1425989871.658 INFO     lxc_conf - mount points have been
setup

Regards,
-- Marco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150310/5062e0bb/attachment.html>


More information about the lxc-users mailing list