[buildd-tools-devel] Bug#762597: /var/lib/schroot/mounts should be in /var/run for --one-file-system

Ian Jackson ijackson at chiark.greenend.org.uk
Tue Sep 23 14:55:40 UTC 2014


Package: schroot
Version: 1.6.4-4

If you have a directory schroot chroot whose source directory is the
same as /, schroot's bind mount in /var/lib/schroot/mounts is
invisible to file tree walking tools.

That is, rsync --one-file-system (rsync -x), cp --one-file-system
(cp -x), find -xdev, etc., do not notice the mount point, and
typically traverse through it.

This is far from ideal.  Now arguably this is a bug in bind mounts
(perhaps a design bug).  But as it happens it is easy to work around
this problem in schroot in a way that is both correct and will fix
almost all the problems:

Move /var/lib/schroot/mounts to /var/run/schroot/mounts or some such.

Typically /var/run is a tmpfs.  As a result there will be a filesystem
with a different devid between / and the chroot.  So to all the file
tree walkers, it will look like two mount points.  Backup tools,
find, etc., will not descend into schroot's bind mount because they'll
stop at /var/run.

Thanks,
Ian.



More information about the Buildd-tools-devel mailing list