locate (and updatedb) is not finding a file
My locate doesn't work for me for some reason. I am using Fedora release 21. This is how I test to see if locate is working:
gavin@localhost:~$ cd
gavin@localhost:~$ touch hellothere
gavin@localhost:~$ sudo updatedb
[sudo] password for gavin:
gavin@localhost:~$ locate hellothere
gavin@localhost:~$ sudo locate hellothere
gavin@localhost:~$
I actually deleted the database and reindexed, but that didn't help:
sudo rm /var/lib/mlocate/mlocate.db
sudo updatedb
(edited to not use /tmp, and use ~ instead)
Here is information on my filesystems:
[~/mnt]$ cat /etc/updatedb.conf *[master]
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 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"
PRUNENAMES = ".git .hg .svn"
PRUNEPATHS = "/afs /media /mnt /net /sfs /tmp /udev /var/cache/ccache /var/lib/yum/yumdb /var/spool/cups /var/spool/squid /var/tmp"
[~/mnt]$ df -h *[master]
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 227G 81G 146G 36% /
devtmpfs 2.9G 0 2.9G 0% /dev
tmpfs 2.9G 24M 2.9G 1% /dev/shm
tmpfs 2.9G 932K 2.9G 1% /run
tmpfs 2.9G 0 2.9G 0% /sys/fs/cgroup
tmpfs 2.9G 405M 2.5G 14% /tmp
/dev/sda3 227G 81G 146G 36% /home
/dev/sda1 477M 154M 295M 35% /boot
tmpfs 587M 48K 587M 1% /run/user/1000
/dev/sr0 1.4G 1.4G 0 100% /run/media/gavin/Fedora-Live-WS-x86_64-21-5
[~]$ cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Dec 9 20:56:27 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=c660d346-c6bd-4beb-9fca-df0878258dfd / btrfs subvol=root 0 0
UUID=71609ae1-3876-48df-96e3-900a45982442 /boot ext4 defaults 1 2
UUID=c660d346-c6bd-4beb-9fca-df0878258dfd /home btrfs subvol=home 0 0
UUID=e2935984-7e92-4efc-8440-c3992f2a9f53 swap swap defaults 0 0
/tmp
isn't evaluated by mlocate. It's volatile content, cleaned out on reboot, and not intended to be storage for anything important.You can check the paths that are pruned from the locate database in the PRUNEPATHS line of
/etc/updatedb.conf
.Thanks, I didn't realize. Unfortunately, it fails for items in my home folder too. I edited my answer.
I'll repost as a comment, since it doesn't directly apply to question anymore, but leave it in for other readers.
I am running F21 and the above procedure works fine for me - i.e.
sudo updatedb
andlocate
return the newly added/touch
ed file. There was no need to remove themlocate.db
file first.PRUNEFS
entry of yourupdatedb.conf
file.My default
/etc/updatedb.conf
ignores the following file systems:@snowolfe I do have tmpfs being used, but not on my home dir. I added information above.