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

wfriedwald

macrumors 6502a
Original poster
Jan 1, 2017
523
48
the basic trick of dragging a volume out of (and then back into) the security / privacy panel is awkward and doesn't seem to work for me ...

is there a more elegant way to force spotlight to reindex the whole system, or a specific volume?

I saw this terminal command on an older web page, not sure if this is something that still works in BIG SUR:

sudo mdutil -E /

grateful for any feedback!

w
 

Solenoid289

macrumors member
Jun 28, 2020
53
49
Japan
Reindex system-wide

Code:
sudo mdutil -a -i off
sudo mdutil -a -i on

For a specific volume.

Code:
sudo mdutil -i off /Volumes/Your Volume Name
sudo mdutil -i on /Volumes/Your Volume Name

Hope this helps.
 
  • Like
Reactions: mudflap

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
The manual page of mdutil (man mdutil) indicates that sudo mdutil -E / is still an option. The manual does not say whether the solution proposed by Solenoid289 actually removes the index.
 

Solenoid289

macrumors member
Jun 28, 2020
53
49
Japan
I've tested with these commands on my very own Mac.
It works.
 

Attachments

  • スクリーンショット 2020-12-16 17.22.07.png
    スクリーンショット 2020-12-16 17.22.07.png
    321 KB · Views: 1,013
  • ss4688.jpg
    ss4688.jpg
    41.1 KB · Views: 1,019

wfriedwald

macrumors 6502a
Original poster
Jan 1, 2017
523
48
great! thank you.

so, for the system wide method, if I have, say, three external drives attached, this will force the reindexing of all three of those drives, as well as the (internal) start-up drive? I assume it will.

In any case, there's no way for this command to harm the system, so I assume it's safe to try it, at least.

Thanks very much!

w

PS: to SOLENOID ... how do you get that indication / notification that the "indexing" process is happening? is that a specific script or something? thanks again!
 

wfriedwald

macrumors 6502a
Original poster
Jan 1, 2017
523
48
hmm... not sure, what is the best way to share the text of the terminal session??

anyhow, not fully sure what happened... thanks again for everyone's output!
 

Attachments

  • terminal text 2020-12-16 1.txt
    2.7 KB · Views: 258

wfriedwald

macrumors 6502a
Original poster
Jan 1, 2017
523
48
before I started, I had three external drives attached :





DR_5TB


NEW4Tbu


ANNEX 4_10TB





however, it seemed to not like the title of the third one (Annex 4_10TB), I thought maybe the blank space was a problem, so I changed it to Annex4_10TB



terminal session Screen Shot 2020-12-16 at 11.16.53 AM.jpg



Last login: Wed Dec 16 10:55:48 on console





The default interactive shell is now zsh.


To update your account to use zsh, please run `chsh -s /bin/zsh`.


For more details, please visit https://support.apple.com/kb/HT208050.


Wills-Mac-mini:~ willfriedwald$ sudo mdutil -a -i off


Password:


/:


2020-12-16 11:01:32.034 mdutil[881:12890] mdutil disabling Spotlight: / -> kMDConfigSearchLevelFSSearchOnly


Indexing disabled.


/System/Volumes/Data:


2020-12-16 11:01:32.193 mdutil[881:12890] mdutil disabling Spotlight: /System/Volumes/Data -> kMDConfigSearchLevelFSSearchOnly


Indexing disabled.


/Volumes/Annex 4_10TB:


2020-12-16 11:01:32.669 mdutil[881:12890] mdutil disabling Spotlight: /Volumes/Annex 4_10TB -> kMDConfigSearchLevelFSSearchOnly


Indexing and searching disabled.


/Volumes/DR_5TB:


2020-12-16 11:01:32.693 mdutil[881:12890] mdutil disabling Spotlight: /Volumes/DR_5TB -> kMDConfigSearchLevelFSSearchOnly


Indexing disabled.


/Volumes/NEW4Tbu:


2020-12-16 11:01:33.123 mdutil[881:12890] mdutil disabling Spotlight: /Volumes/NEW4Tbu -> kMDConfigSearchLevelFSSearchOnly


Indexing and searching disabled.


Wills-Mac-mini:~ willfriedwald$ sudo mdutil -a -i on


/:


Indexing enabled.


/System/Volumes/Data:


Indexing enabled.


/Volumes/Annex 4_10TB:


Indexing and searching disabled.


/Volumes/DR_5TB:


Indexing enabled.


/Volumes/NEW4Tbu:


Indexing and searching disabled.


Wills-Mac-mini:~ willfriedwald$ sudo mdutil -i on /Volumes/Annex 4_10TB


Error: invalid path `/Volumes/Annex'.


Error: invalid path `4_10TB'.





WF: as you can see, here is where I changed the name of that third volume (external drive)








Wills-Mac-mini:~ willfriedwald$ sudo mdutil -i on /Volumes/Annex4_10TB


/System/Volumes/Data/Volumes/Annex4_10TB:


Indexing and searching disabled.


Wills-Mac-mini:~ willfriedwald$ sudo mdutil -i on /Volumes/Annex4_10TB


/System/Volumes/Data/Volumes/Annex4_10TB:


Indexing and searching disabled.


Wills-Mac-mini:~ willfriedwald$ sudo mdutil -i off /Volumes/Annex4_10TB


/System/Volumes/Data/Volumes/Annex4_10TB:


2020-12-16 11:04:55.721 mdutil[1528:19937] mdutil disabling Spotlight: /System/Volumes/Data/Volumes/Annex4_10TB -> kMDConfigSearchLevelFSSearchOnly


Indexing and searching disabled.


Wills-Mac-mini:~ willfriedwald$ sudo mdutil -i on /Volumes/Annex4_10TB


/System/Volumes/Data/Volumes/Annex4_10TB:


Indexing and searching disabled.


Wills-Mac-mini:~ willfriedwald$





WF: not sure where I am now ... is there any way to tell which drives are successfully being reindexed?
 

wfriedwald

macrumors 6502a
Original poster
Jan 1, 2017
523
48
thanks... I tried that and got this - as you can see, the "tricky" volume that I re-named is there, with the new name...


Wills-Mac-mini:~ willfriedwald$ ls /Volumes


Annex4_10TB DR_5TB JEFF_1T MACINTOSH HD NEW4Tbu


Wills-Mac-mini:~ willfriedwald$

not sure why "JEFF" turned up - it is NOT currently mounted!

 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
There isn’t enough information.

How are the disks formatted (which format)? What is the result of mdutil -sa?

Are the drives mentioned in System Preferences → Spotlight → Privacy perhaps?

Please stop using black text. In dark mode, your posts are barely readable.
 

wfriedwald

macrumors 6502a
Original poster
Jan 1, 2017
523
48
sorry, all the drives are in MAC format.

checking the SPOTLIGHT / PRIVACY panel - it is completely empty.

I tried
mdutil -sa?

here is the latest - sorry about previous screenshot, I hope this is more readable -
terminal session Screen Shot 2020-12-16 02.jpg


and thank YOU again!
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
The ? was not part of the query, just:
Code:
mdutil -sa

The problem appears to be that Spotlight does not index those volumnes, even if you enforce it. Try also enabling a particular volume explicitly with verbose output:
Code:
sudo mdutil -v -i on /Volumes/Annex4_10TB
sudo mdutil -v -i on /Volumes/NEW4tbu

Perhaps it tells you the problem.

The only other thing that I know of that might affect this is a hidden file called “.metadata_never_index” on the volume. Can you try this also?
Code:
find /Volumes/Annex4_10TB /Volumes/NEW4tbu -name .metadata_never_index 2>/dev/null

Have you tried using the -E option as mentioned in your first post to clear out the cache?
 

wfriedwald

macrumors 6502a
Original poster
Jan 1, 2017
523
48
hey thank you! this is what I get -

still disabled for those two volumes

no results in the search for that possible hidden file.

hope I can get something to work - thanks again!

w


terminal session Screen Shot 2020-12-16 03.jpg
 

stooovie

macrumors 6502a
Nov 21, 2010
836
314
Same here. No solution works so far. External HFSplus drive on M1 Air, Big Sur 11.2.1.
 

wfriedwald

macrumors 6502a
Original poster
Jan 1, 2017
523
48
I am sorry to hear that you are also being affected by this problem, but part of me is somewhat relieved that you are NOT the only one!

I asked someone if this was a new problem that arrived with Big Sur, but apparently not, this is a bug that has been in the MAC OS a long time. and it's only certain drives.

I have recently started using a third party search application call NEOFINDER. Highly recommended. The drawback is that you have to index the drive first, and then you can search it. But it does NOT depend on Spotlight, and that is the good thing. it's the only way I can find things on certain external drives where Spotlight just does not work!

w
 

difrag

macrumors newbie
Jan 11, 2022
1
0
I ran into the same issue the other day on Big Sur. I came across an article that outlined the following steps to solve this issue with Spotlight. It worked for me, so it might work for you as well.

Try this in terminal, just copy and paste:

Stop Spotlight:

# launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Unload failed: 5: Input/output error (you will receive this error if Spotlight is already disabled)


Start Spotlight:

# launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist


Start Spotlight indexing:

# mdutil -a -i on

/:
Error: unable to perform operation. Try as root. (-1)
Indexing disabled.
/System/Volumes/Data:
Indexing disabled.


I tried it again with sudo:

# sudo mdutil -a -i on

/:
Indexing enabled.
/System/Volumes/Data:
Indexing enabled.

Viola, it worked right away; Spotlight is currently indexing the main SSD.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.