[Lxc-users] [lxc-users] Sharing the host /lib with ubuntu 10.04 guest
Serge E. Hallyn
serge.hallyn at canonical.com
Wed Nov 3 01:09:31 UTC 2010
Quoting Pierre-François Bonnefoi (pierre-francois.bonnefoi at unilim.fr):
> hello,
>
> I've encountered a new problem :
> I would like to decrease the disk usage of my container by sharing some big directories.
> When I try to share the /lib directory between my host under Ubuntu 10.04 with my guest under Ubuntu 10.0.4, I've got the problem that the file /lib/init/fstab from the host is shared with the container and create some panic with some not needed mounts.
> I've try to define a /etc/fstab but I can't prevent the guest system to analyze the /lib/init/fstab file.
> (And I don't want to modify my host Ubuntu...).
>
> How could I perform this ?
Hm, I'm not sure about the sequence of events, but I suspect you could
put
/etc/containerfstab /lib/init/fstab none defaults 0 0
into /var/lib/lxc/${CONTAINERNAME}/fstab. That should happen
after the mounts namespace has been unshared, and before the
container's init process does mountall. A good start for /etc/containerfstab
might be the stock container fstab:
######################################################
# /lib/init/fstab: lxc system fstab
none /spu spufs gid=spu,optional 0 0
none /tmp none defaults 0 0
none /var/lock tmpfs nodev,noexec,nosuid,showthrough 0 0
none /lib/init/rw tmpfs mode=0755,nosuid,optional 0 0
######################################################
-serge
More information about the lxc-users
mailing list