How to prevent updatedb scanning certain mount points?

I have a ZFS mount point in /zfs/pool and updatedb is scanning it:

# zpool export zfs
cannot unmount '/zfs': pool or dataset is busy
# lsof +D /zfs
lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
COMMAND    PID USER FD   TYPE DEVICE SIZE/OFF NODE NAME
updatedb 10989 root 17r   DIR   0,50        6   34 /zfs

I already have it configured to not scan that location but does it anyway:

# cat /etc/updatedb.conf 
PRUNE_BIND_MOUNTS = "no"
PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs cpuset cramfs debugfs devpts devtmpfs ecryptfs exofs ftpfs fuse fuse.encfs fuse.s3fs fuse.sshfs fusectl gfs gfs2 hugetlbfs inotifyfs iso9660 jffs2 lustre mqueue ncpfs nfs nfs4 nfsd pipefs proc ramfs rootfs rpc_pipefs securityfs selinuxfs sfs shfs smbfs sockfs sshfs sysfs tmpfs ubifs udf usbfs vboxsf"
PRUNENAMES = ".git .hg .svn"
PRUNEPATHS = "/afs /media /mnt /net /sfs /tmp /udev /var/cache /var/lib/pacman/local /var/lock /var/run /var/spool /var/tmp /zfs"

Any help why it’s happening?

Is it really being scanned? See the following comment from the man page… :point_down:

Yes it’s being scanned or at least has a hold on it. After killall updatedb I could immediately export the ZFS pool.

You can check whether it is actively being scanned by using locate on a filename or directory of which you know it only exists under that mountpoint. If you get no results, then it’s not being scanned.

Maybe it’s not being scanned but still is opened by the process.

1 Like

Well, that would make sense, since the name of the mountpoint itself needs to be indexed as well.