Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

genius7

macrumors newbie
Original poster
May 25, 2008
14
1
When using Spotlight search, it is not finding a specific file, which I know is located on my Time Capsule drive, which, of course, is mounted and indexing thereof is enabled. Please, see below relevant Terminal extract:
Bash:
Martin@Martins-MacBook-Pro ~ % mdutil -s /                                                             
/:
    Indexing enabled.
Martin@Martins-MacBook-Pro ~ % mdutil -s /Volumes
/System/Volumes/Data/Volumes:
    Indexing enabled.
Martin@Martins-MacBook-Pro ~ % mdutil -s /Volumes/Time\ Capsule
/System/Volumes/Data/Volumes/Time Capsule:
    Indexing enabled.
Martin@Martins-MacBook-Pro ~ % ls -l /Volumes/Time\ Capsule/Documents/Afrikaans                     
total 15296
-rwxrwxrwx@ 1 Martin  staff        0 Jan 15  2012 Icon?
drwxrwxrwx@ 1 Martin  staff      264 Jan 20  2012 Teach Yourself - Afrikaans
-rwxrwxrwx@ 1 Martin  staff  7761600 Aug  9 09:33 afrikaans woorden.txt

Martin@Martins-MacBook-Pro ~ % find /Volumes/Time\ Capsule/Documents/Afrikaans -iname "*woorden*"     
/Volumes/Time Capsule/Documents/Afrikaans/afrikaans woorden.txt
Martin@Martins-MacBook-Pro ~ % mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans -name afrikaans     
Martin@Martins-MacBook-Pro ~ % mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans/ -name afrikaans
Martin@Martins-MacBook-Pro ~ % sudo mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans -name afrikaans
Martin@Martins-MacBook-Pro ~ % sudo mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans/ -name afrikaans
Martin@Martins-MacBook-Pro ~ %
I have tried rebuilding the indexing by adding and removing the drive from the Spotlight Privacy tab.

I have also tried manually importing the file using mdimport command?
Bash:
Martin@Martins-MacBook-Pro ~ % ls -l /Volumes/Time\ Capsule/Documents/Afrikaans/
total 15296
-rwxrwxrwx@ 1 Martin  staff        0 Jan 15  2012 Icon?
drwxrwxrwx@ 1 Martin  staff      264 Jan 20  2012 Teach Yourself - Afrikaans
-rwxrwxrwx@ 1 Martin  staff  7761600 Aug  9 09:33 afrikaans woorden.txt
Martin@Martins-MacBook-Pro ~ % mdimport /Volumes/Time\ Capsule/Documents/Afrikaans/afrikaans\ woorden.txt
Martin@Martins-MacBook-Pro ~ % mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans -name woorden
Martin@Martins-MacBook-Pro ~ % mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans/ -name woorden
Martin@Martins-MacBook-Pro ~ % sudo mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans -name woorden
Password:
Martin@Martins-MacBook-Pro ~ % sudo mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans/ -name woorden
Martin@Martins-MacBook-Pro ~ %


Also, there is no .metadata_never_index file at the root of the volume, which would prevent it from being indexed.
Bash:
Martin@Martins-MacBook-Pro ~ % ls -la /Volumes/Time\ Capsule | grep .metadata_never_index
Martin@Martins-MacBook-Pro ~ %


What should I do? Please help! Thanks
 

bernuli

macrumors 6502a
Oct 10, 2011
710
403
When using Spotlight search, it is not finding a specific file, which I know is located on my Time Capsule drive, which, of course, is mounted and indexing thereof is enabled. Please, see below relevant Terminal extract:
Bash:
Martin@Martins-MacBook-Pro ~ % mdutil -s /                                                            
/:
    Indexing enabled.
Martin@Martins-MacBook-Pro ~ % mdutil -s /Volumes
/System/Volumes/Data/Volumes:
    Indexing enabled.
Martin@Martins-MacBook-Pro ~ % mdutil -s /Volumes/Time\ Capsule
/System/Volumes/Data/Volumes/Time Capsule:
    Indexing enabled.
Martin@Martins-MacBook-Pro ~ % ls -l /Volumes/Time\ Capsule/Documents/Afrikaans                    
total 15296
-rwxrwxrwx@ 1 Martin  staff        0 Jan 15  2012 Icon?
drwxrwxrwx@ 1 Martin  staff      264 Jan 20  2012 Teach Yourself - Afrikaans
-rwxrwxrwx@ 1 Martin  staff  7761600 Aug  9 09:33 afrikaans woorden.txt

Martin@Martins-MacBook-Pro ~ % find /Volumes/Time\ Capsule/Documents/Afrikaans -iname "*woorden*"    
/Volumes/Time Capsule/Documents/Afrikaans/afrikaans woorden.txt
Martin@Martins-MacBook-Pro ~ % mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans -name afrikaans    
Martin@Martins-MacBook-Pro ~ % mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans/ -name afrikaans
Martin@Martins-MacBook-Pro ~ % sudo mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans -name afrikaans
Martin@Martins-MacBook-Pro ~ % sudo mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans/ -name afrikaans
Martin@Martins-MacBook-Pro ~ %
I have tried rebuilding the indexing by adding and removing the drive from the Spotlight Privacy tab.

I have also tried manually importing the file using mdimport command?
Bash:
Martin@Martins-MacBook-Pro ~ % ls -l /Volumes/Time\ Capsule/Documents/Afrikaans/
total 15296
-rwxrwxrwx@ 1 Martin  staff        0 Jan 15  2012 Icon?
drwxrwxrwx@ 1 Martin  staff      264 Jan 20  2012 Teach Yourself - Afrikaans
-rwxrwxrwx@ 1 Martin  staff  7761600 Aug  9 09:33 afrikaans woorden.txt
Martin@Martins-MacBook-Pro ~ % mdimport /Volumes/Time\ Capsule/Documents/Afrikaans/afrikaans\ woorden.txt
Martin@Martins-MacBook-Pro ~ % mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans -name woorden
Martin@Martins-MacBook-Pro ~ % mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans/ -name woorden
Martin@Martins-MacBook-Pro ~ % sudo mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans -name woorden
Password:
Martin@Martins-MacBook-Pro ~ % sudo mdfind -onlyin /Volumes/Time\ Capsule/Documents/Afrikaans/ -name woorden
Martin@Martins-MacBook-Pro ~ %


Also, there is no .metadata_never_index file at the root of the volume, which would prevent it from being indexed.
Bash:
Martin@Martins-MacBook-Pro ~ % ls -la /Volumes/Time\ Capsule | grep .metadata_never_index
Martin@Martins-MacBook-Pro ~ %


What should I do? Please help! Thanks

how about searching from within the Time Machine GUI. Can you find the file then?

I don’t think time machine files will show up on a standard spotlight search. especially Time capsule as the drive only supposed to be mounted when backing up
 

genius7

macrumors newbie
Original poster
May 25, 2008
14
1
This has nothing to do with Time Machine. Mdfind is Spotlight command, not related to Time Machine. Doing the same search using Spotlight via CMD+Spacebar works:

Screenshot 2020-08-21 at 22.21.26.png
 

bernuli

macrumors 6502a
Oct 10, 2011
710
403
This has nothing to do with Time Machine. Mdfind is Spotlight command, not related to Time Machine. Doing the same search using Spotlight via CMD+Spacebar works:

Oh I see what you are saying now.

I could not get mdfind to return any results from networked volumes, mounted using either smb or afp.

Tried macOS 10.15, 10.14, 10.11 and 10.9

mdfind seems to only look at local volumes. I have found no command line option to do such spotlight searches of networked volumes. The only option appears to be using the Finder as you are doing.

Spotlight does create a local database for network attached volumes for which you have turned indexing on (mdutil -i on /Volumes/xxxx). These are in:
/private/var/db/Spotlight-V100/LocalVolumes/afp%3A%2F%2F//user@192.168.xxx.xxx/volumeName/Store-V2/UUID/

But I have found no way to query this database on the command line.
 

genius7

macrumors newbie
Original poster
May 25, 2008
14
1
That's very peculiar because I can get Spotlight to return search results from my network drives, just not Time Capsule.
 

Boyd01

Moderator
Staff member
Feb 21, 2012
7,744
4,609
New Jersey Pine Barrens
I can get Spotlight to return search results from my network drives, just not Time Capsule.

This is what I see too. Just tried searching for a known file on my time capsule and no results were returned. Tried the same thing from another network drive and instantly got a list of hits. I am still using the Time Capsule for wifi access, but not storage. The disk has always been unbearably slow, and at least three times over the years it said that my time machine backups were corrupt and needed to be deleted and started again from scratch.
 

bernuli

macrumors 6502a
Oct 10, 2011
710
403
That's very peculiar because I can get Spotlight to return search results from my network drives, just not Time Capsule.


Wait, in your post #5 you show that it IS working. CMD+spacebar in Finder will return results from the Time Capsule. **When you do a Spotlight search like this with Finder, you have to select "Shared" as you did then it works.**

I am seeing the same behavior on my Time Capsule. Spotlight will return results from the afp mounted drive in the Time Capsule.

It is the command line 'mdfind' that does NOT work. mdutil does not seem to know about /private/var/db/Spotlight-V100/LocalVolumes or perhaps ignores it. Apple perhaps limited mdutil to locally mounted drives the limit the query time.

Or am I still not understanding the question?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.