Sunday, April 11, 2010

Searching Removable Drives Linux

Had some trouble with something I'd had earlier trouble with in the past.  When using the locate command (even after running updatedb), I was unable to search my removable USB drives.

The solution was to modify the /etc/updatedb.conf file, and remove /media from the prune path:

# PRUNENAMES=".git .bzr .hg .svn"
PRUNEPATHS="/tmp /var/spool /media"
PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf"

Guess this was more a mental note to myself :).


  1. that worked great thanks!

  2. My gosh! Looking up how to use the locate and updatedb did nothing. I'm a simple end-user trying to help my dad switch to Linux (Mint, in this case).

    I rarely search for files and haven't had to do so outside of my local drives (I kinda use my daily driver linux box like a netbook). Everything my dad stores is on an external drive. Imagine when I went to show him how great the locate command is for sheer speed... and it turned up nothing.

    There was no mention of DEFAULT prune paths in anything I read. In fact the info I found said that updatedb indexes everything in root (/) down by default. Maybe I missed it in the man pages, but I don't think so. I'm grateful that you saw fit to put this solution out there. I wish more people would document their solutions to those... well... niggling little troubles that crop up when learning a new OS.