Comment 4 for bug 382330

Revision history for this message
Dave Duback (dwduback) wrote :

Yes, I have confirmed this, for Ubuntu 13.04 and mlocate 0.25.

I found that the PRUNEPATHS variable in /etc/updatedb.conf includes /media. For me, the default mount point for a USB device with a label (hard drive OR stick) is /media/dave/{disk label} with me as user dave. I removed '/media' from PRUNEPATHS in /etc/updatedb.conf and now get the proper results when searching databases for devices not currently mounted.

The trick here will be making sure a device is not mounted to /media at the time the cron job for updatedb runs, or find a way to run mlocate without a check for the current existence of a path before reporting a result. In the source for mlocate version 0.25, the implication is that -e (check for existence) defaults to FALSE but this was not EXPLICIT in the declaration.

The PRUNEPATHS variable is stored in the header of a .db file. The anamoly seems to be if you specify /media/user/usbdrive as the root for updatedb (updatedb -U /media/user/usbdrive), and /media is in PRUNEPATHS at that time, the database is generated correctly (all files catalogged), but subsequent searches fail if /media is in /etc/updatedb.conf.

Again, when I removed '/media' from PRUNEPATHS in /etc/updatedb.conf, my existing set of nineteen databases scanned from mount points /media/dave/{disk label} is properly scanned.