By default, updatedb indexes only your root partition when run. To be able to extend locate‘s reach and get updatedb to index external devices such as USB harddisks and flash drives, edit the /etc/updatedb.conf file. Modify the following line:
PRUNEPATHS=”/tmp /var/spool /media”
so that it reads
PRUNEPATHS=”/tmp /var/spool”
This adds the devices mounted in the /media directory to the search path.
Thanks so much for this tip! I can’t believe it took me so long to find this out.