[lxc-devel] lxc.mount.entry for overlayfs

Christian Brauner christianvanbrauner at gmail.com
Fri Oct 2 14:36:37 UTC 2015


While working on ephemeral container I observed on shortcoming regarding overlay
mount entries: Currently users cannot simply specify an entry

lxc.mount.entry = /home/chb/files/Bucket opt overlay lowerdir=/home/chb/files/Bucket:/home/chb/files/Paper,upperdir=/absolute/path/to/containerdir/delta0,workdir=/absolute/path/to/container/workdir0,create=dir

without previously mkdir upperdir and workdir under the containers directory
(Mind, not under the rootfs of the container.)

I would be in favour of making this possible. It seems like we could add a
function in conf.c:

        mount_entry_create_overlay_dirs()

which parses mntent->opts for upperdir and workdir and which is called in

        mount_entry_create_dir_file()

(which is responsible for creating directories which are needed under the
containers rootfs.)

We would check if we have mntent->mnt_type == "overlay"/"overlayfs"/"aufs" and
then call mount_entry_create_overlay_dirs(). This would also make things easier
like having users specify overlay-mounts from the command line for things like
lxc-copy. Would this be considered a good idea? If yes, how should we create the
upperdir and workdir (E.g. assigning random suffixes to to the (lowest)
lowerdir?) And should we have a dedicated place to put them and what would its
name be (e.g. /path/to/containerdir/tmpfs/delta0 etc...)?

Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20151002/6702617b/attachment.sig>


More information about the lxc-devel mailing list