[lxc-users] fstab vs lxc.mount.entry

Stéphane Graber stgraber at ubuntu.com
Sat Dec 20 23:19:55 UTC 2014


Depends on the order of your config, it's sequential, so you could have:

lxc.mount.entry = foo
lxc.mount = /var/lib/lxc/blah/fstab
lxc.mount.entry = bar

and it'd first process foo, then process anything in fstab and then
process bar.

On Sat, Dec 20, 2014 at 10:25:19PM +0100, BB wrote:
> Thanks for the answer. I was not sure if there is some subtle difference
> between alternatives 1) and 2).
> 
> Is 1) applied before 2) or vice versa?
> 
> Best regards,
> 
> BB
> 
> On Sat, Dec 20, 2014 at 9:10 PM, Stéphane Graber <stgraber at ubuntu.com>
> wrote:
> 
> > On Sat, Dec 20, 2014 at 09:00:50PM +0100, BB wrote:
> > > Hi,
> > >
> > > is there any significant difference between the configuration of mounts
> > in
> > > the container's fstab file versus lxc.mount.entry entries in the
> > > container's config file?
> > > I am currently using only the former method.
> > >
> > > Best regards,
> > >
> > > BB
> >
> > So there are at least three ways you can handle mounts in a container:
> > 1) Use lxc.mount.entry in the container's config
> > 2) Use lxc.mount pointing to a file on the host
> > 3) Use /etc/fstab inside the container's rootfs
> >
> > 1) and 2) are essentially identical as any entry in the fstab-like file
> > pointed to by lxc.mount is parsed using the same parse as
> > lxc.mount.entry.
> >
> > 3) Is different in that it's the parser in the rootfs which will process
> > this and do any required mounts. In this case, your mounts may be
> > rejected due to apparmor, selinux, seccomp or user namespaces
> > restrictions and also will not allow you to bind-mount resources from
> > the host.
> >
> > --
> > Stéphane Graber
> > Ubuntu developer
> > http://www.ubuntu.com
> >
> > _______________________________________________
> > lxc-users mailing list
> > lxc-users at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-users
> >

> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20141220/27452235/attachment.sig>


More information about the lxc-users mailing list