3

I had a look at man locate but couldn't find an answer to this.

The updatedb command appears to index everything under /, but according to my experiment it didn't index a file at /media/mike/W10 D drive/nonsense_file.

Am I to suppose that it excludes mounted media volumes/locations? Is this documented somewhere? Is there some way of choosing to include some of these locations?

mike rodent
  • 1,132

2 Answers2

4

The configuration is in the file /etc/updatedb.conf. It may look like this:

# /etc/updatedb.conf: config file for mlocate

# This file sets variables that are used by updatedb.
# For more info, see the updatedb.conf(5) manpage.

# Filesystems that are pruned from updatedb database
PRUNEFS="9p afs anon_inodefs auto autofs bdev binfmt binfmt_misc ceph fuse.ceph cgroup cifs coda configfs cramfs cpuset debugfs devfs devpts devtmps ecryptfs eventpollfs exofs futexfs ftpfs fuse fusectl gfs gfs2 gpfs hostfs hugetlbfs inotifyfs iso9660 jffs2 lustre misc mqueue ncpfs nfs NFS nfs4 nfsd nnpfs ocfs ocfs2 pipefs proc ramfs rpc_pipefs securityfs selinuxfs sfs shfs smbfs sockfs spufs sshfs subfs supermount sysfs tmpfs ubifs udf usbfs vboxsf vperfctrfs"

# Paths which are pruned from updatedb database
PRUNEPATHS="/tmp /var/tmp /var/cache /var/lock /var/run /var/spool /mnt /cdrom /usr/tmp /proc /media /sys /.snapshots /var/run/media"

# Folder names that are pruned from updatedb database
PRUNENAMES = ".git .hg .svn .bzr .arch-ids {arch} CVS"

# Skip bind mounts.
# DISABLED for bnc#994663 and to avoid btrfs subvolume issues
PRUNE_BIND_MOUNTS="no"

You can exclude file system types, paths/folders and named folders as the documentation says.

Please see the man page for details.

Ned64
  • 8,726
2

See the config file, /etc/updatedb.conf and the man page for updatedb.conf.

$ cat /etc/updatedb.conf
PRUNE_BIND_MOUNTS = "yes"
PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs cpuset debugfs devpts ecryptfs exofs fuse fuse.sshfs fusectl gfs gfs2 gpfs hugetlbfs inotifyfs iso9660 jffs2 lustre mqueue ncpfs nfs nfs4 nfsd pipefs proc ramfs rootfs rpc_pipefs securityfs selinuxfs sfs sockfs sysfs tmpfs ubifs udf usbfs ceph fuse.ceph"
PRUNENAMES = ".git .hg .svn .bzr .arch-ids {arch} CVS"
PRUNEPATHS = "/afs /media /mnt /net /sfs /tmp /udev /var/cache/ccache /var/lib/yum/yumdb /var/lib/dnf/yumdb /var/spool/cups /var/spool/squid /var/tmp /var/lib/ceph"
$
steve
  • 21,892