Bug 772493

Summary: updatedb in Fedora 16 is not indexing other mounted filesystems
Product: [Fedora] Fedora Reporter: Louis van Dyk <louis>
Component: mlocateAssignee: Miloslav Trmač <mitr>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 16CC: mitr
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-09 12:25:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Requested Log file output none

Description Louis van Dyk 2012-01-08 20:52:21 UTC
Description of problem:
I used to run F14 before re-installing with F16.  My /etc/updatedb.conf file in F14 and my /etc/fstab file in F14 are almost identical to my files in F16 (except for the obvious differences). Yet, where in F14 the drives mounted as /media/1TB_Drive and as /media/2TB-Drive were indexed by mlocate, now, in F16, they are ignored. And yes, I have removed /media from updatedb.conf and set the prunebindmounts to no.

Version-Release number of selected component (if applicable):
mlocate-0.24-1.fc16.x86_64

How reproducible:
Still doing it - so ALWAYS.

Steps to Reproduce:
1. In /etc/fstab include:
UUID=3ca845e0-5f32-40a0-bf08-e66c5d62c46f /media/2TB-Drive      ext4    defaults        1 2
/dev/sdc1   /media/1TB_Drive    ext4    rw,nosuid,nodev,relatime,seclabel,user_xattr,acl,barrier=1,data=ordered,uhelper=udisks  1   2

2.  In /etc/updatedb.conf set:
PRUNE_BIND_MOUNTS = "no"
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 /mnt /net /sfs /tmp /udev /var/cache/ccache /var/spool/cups /var/spool/squid /var/tmp"

3.  Run updatedb manually, or allow cron to run it daily.
  

Actual results:
Run locate any file on the drives listed in (1.) and it is not reported, yet files on the root filesystem ARE.


Expected results:
In the past, a file on one of the drives in (1.) would be found and listed when running locate.

Additional info:
This worked perfectly when this system was running Fedora 14.

Comment 1 Miloslav Trmač 2012-01-09 10:29:31 UTC
Thanks for your report.

Please modify the last line of /etc/cron.daily/mlocate.cron to read
> /usr/bin/updatedb --debug-pruning -f "$nodevs"
then as root run
> /etc/cron.daily/mlocate.cron 2>log
and attach the generated "log" file.

Comment 2 Louis van Dyk 2012-01-09 11:58:00 UTC
Created attachment 551541 [details]
Requested Log file output

Comment 3 Miloslav Trmač 2012-01-09 12:25:34 UTC
Thanks.

This is caused by system mounting a tmpfs over /media , which automatically excludes everything in that subtree.  updatedb is therefore behaving as designed, and I can't see a simple way to do it otherwise.

You can do one of these things to disable the /media exclusion:
* Disable the /media mount ( http://lists.fedoraproject.org/pipermail/users/2011-December/410968.html )
* Remove tmpfs from PRUNEFS in updatedb.conf
* Mount your disks elsewhere.

I can't say I understand why the /media mount exists, but it was clearly intentional (see bug 693449 for example).

Comment 4 Louis van Dyk 2012-01-09 13:52:03 UTC
Many thanks Miloslav

Knowing that I was doing something contrary to "normal" system practices is just as good as a bug fix.

Thanks for the link to that article, it explains everything well.

I personally think that mounting /media as a tmpfs is silly, but I guess I will now have to make another plan.

I now also understand why the process had worked on Fedora 14.

So I agree that for mlocate you have implemented the best behaviour, but for my purposes I will then remove tmpfs from PRUNEFS in my updatebd.conf.