Red Hat Bugzilla – Bug 221755
updatedb doesn't skip bind mounts
Last modified: 2007-11-30 17:11:52 EST
When bind mounts are present updatedb enters them and lists the files several
times. Currently only modifying PRUNEPATHS seems to help.
Is there a better way to skip bind mounts w/o having to explicitely maintain a
list of them? If not is it worth while adding such a check to mlocate? Thanks!
Thanks for your report.
I have seen bind mounts used in both of these ways:
a) mount --bind /home /path/to/chroot/home
b) mount --bind /mnt/big_disk /home/big_user
For a) the right thing is to ignore the destination, for b) to ignore the
source. I don't think mlocate can automatically determine what it should do.
Always ignore the destination. The same argument could be brought forward for
symlinks, in fact usecase b) should seriously consider using symlinks or
directly mounting big_disk's device into /home/big_user.
Even for b) the admin will be grateful for not hammering his big_disk multiple
times. And with systems that do this multiple times (think of Fedora build
servers bind-mounting whole kernel-src trees into chroots or any other chroot
setup like http, ftp etc. bind-mounting the contents) you actually stall the
system into updatedb until noon (and that's on FC-SAN).
Since this is actually killing servers, I'm not considering this a feature
request anymore, but indeed a bug. At the very least it should be up to the
admin to decide on whether to follow bind-mounts or not. Currently the options
are no updatedb at all of nfs-mounting from localhost instead of bind-mounts,
which kills performance.
Thanks, I didn't realize there are legitimate cases of bind mounting the same
subtree ten or more times.
mlocate-0.16 has PRUNE_BIND_MOUNTS; disabled by default upstream, but enabled in
the Fedora package.
Thanks a ton, Miloslav, I'm going to test it on the FC6 setups by rebuilding the