[Lxc-users] umount filesystems on container shutdown

Michael H. Warfield mhw at WittsEnd.com
Thu Apr 1 04:48:19 UTC 2010


On Thu, 2010-04-01 at 00:10 +0200, "Matthias P. Würfl" wrote: 
> Hi!

> I have a filesystem mounted where all my container resides in. When i 
> shutdown a container this filesystem is remounted ro. As far as i can 
> tell this is done by the init-scripts of the container.

This is actually a known problem and has been under discussion on the
lxc-devel list recently.  I've managed to avoid this by using a bind
mount for the rootfs in the fstab and have the rootfs point to the
target of the bind mount.  Something like this:

Config for container 1000:

lxc.rootfs = /srv/lxc/rootfs
lxc.mount = /srv/lxc/config/1000.fstab

1000.fsab:

/srv/lxc/private/1000 /srv/lxc/rootfs    none bind 0 0

Put your machine in /srv/lxc/private/1000.  Nothing ever actually shows
up (to the host) in /srv/lxc/rootfs (the bind mounts are in the
container space) but it seems to isolate the container rootfs from your
partition and the remount doesn't seem to propagate.

Please check the archives for the devel list for more information and
the discussion regarding this and some related issues.

> I can modify the init-scripts of the container, but isn't there a way to 
> forbid the container to do things with the filesystem of the host?
> 
> Grüße aus Deutschland,
> 
> Matthias

Mike
-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20100401/cc2f20e0/attachment.pgp>


More information about the lxc-users mailing list