[lxc-devel] define a mount point for the rootfs

Daniel Lezcano dlezcano at fr.ibm.com
Wed May 12 11:00:21 UTC 2010


The previous code was creating a temporary directory /tmp/lxc-xxxx to
mount the rootfs, this is needed to separate the filesystem for the
pivot_root, when the rootfs and the host fs are the same.

According to the pivot_root man page:
"new_root and put_old must not be on the same file system as the current root."

Unfortunately, /tmp was populated with a temporary directory which was
never removed and furthermore, as Michael Tokarev pointed it, we can not
mount on read-only system fs on the host due to this directory creation.

A dirty fix was made to use /tmp to mount the rootfs, but of course that
will prevent to put the rootfs in /tmp.

This patchset address these problems by setting a default mount point,
$localstatedir/run/lxc, (it is up to the user to create this directory
when installing lxc by a manual mkdir, a rpm, a deb or whatever).
May be /var/run/lxc is not good place ... Just let me know.

If the user wants to override this mount point, then he can use
the configuration option 'lxc.rootfs.mount=<path>'.

TODO : check if we can get rid of this rbind mount if rootfs and hostfs
are not on the same fs.





More information about the lxc-devel mailing list