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

Auggie

macrumors 6502
Original poster
Jan 21, 2017
389
108
I need to disable Spotlight from indexing any new, "non-permanent" volumes (i.e. external drives), such as from a NAS and USB drives.

I can't possibly try to manually add every single new volume to Spotlight's Privacy tab, which is bit buggy to begin with anyways as it seems to "forget" all removable volumes and would require re-adding them back whenever they are remounted.

I don't want to disable Spotlight entirely via the Terminal mdutil command as I need my mail, both in OS X's Mail and in Microsoft's Outlook, to be searchable (disabling mdutil disables searching my mail).

Is there a way?
 
Yes. You can use the following command, which simply changes a preference via command line, for all external volumes (local and network):

To have mds ignore all external volumes including network volumes run the following command:

$ sudo defaults write /Library/Preferences/com.apple.SpotlightServer.plist ExternalVolumesIgnore -bool True

To be able to re-enable indexing for certain external volumes, run this command instead:

$ sudo defaults write /Library/Preferences/com.apple.SpotlightServer.plist ExternalVolumesDefaultOff -bool True

Here is the full info, details, and undo if you change your mind, or it is not working as you need it to.

If you are uncomfortable with CLI notice at the bottom of the page there are two profiles; you can test either/both as they get added to your System Prefs, and can be removed easily without any CLI interaction at any future point.

I have not tested them....so can't confirm they work as expected, and on which OS.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.