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

helenelliott

macrumors newbie
Original poster
Oct 30, 2019
1
0
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?
 
The "don't index this" file is simply an empty text file named ".metadata_never_index" that is located in each volume's root/base directory, so you are still stuck with manually creating it or adding the volume to the privacy tab.
 
Try this command (include the quotation marks as a part of the command):

sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"

(no promises, but worth a try)
 
Spotlight should remember that a volume is in the Privacy tab, because that information is stored on the external volume.

If a volume is unindexed because it's in the Privacy tab, then the volume is unmounted, the setting will disappear from Privacy because the data on the volume is unmounted. But it should come back when the volume is remounted, without having to re-add the volume to the Privacy tab.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.