Apple Intelligence is now available on iPhone, iPad, and Mac!

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Disable spotlight for External Drives

I have 5 macs, and several USB and Firewire drives. Most of these external drives are plugged into different machines from time to time. None sit permanantly in any machine (because most of my machines are laptops).


I'd like to prevent Spotlight from indexing my External drives.


I know I can (after plugging in a EXT drive), use the privacy function in the Spotlight Preferences. But with a dozen or so external drives (HDD and Thumb) on 5 machines, that's too much work each time I plug a drive into a machine.


I read that the existence of a ".metadata_never_index" file prevents Spotlight indexing. I assume this works, but it's hard to tell for sure, because the moment I plug a drive in, my machine seems to start indexing faster than I can create this file. So I wind up with a .Spotlight-V100 directory. I was hoping that OSX would delete this for me after I set Privacy or add the ".metadata_never_index" file. But it does not. It may be that I have to delete it manually (probably because Privacy is a COMPUTER setting (not on HDD setting).


QUESTIONS:

  1. Does the ".metadata_never_index" file supported by OSX (Mavericks and MtnLion).
  2. Can I delete the .Spotlight-V100 directory in my EXT Drives, without the risk of causing a problem?
  3. If I put a ".metadata_never_index" file in /Volume, will it effectively prevent indexing on any mounted drive, without affecting the Macintosh HD indexing?
  4. Is there an non-invisible equivilent to ".metadata_never_index" (so it's more obvious when indexing is turned off).

Posted on Oct 26, 2013 7:41 AM

Reply
7 replies

Oct 26, 2013 8:09 AM in response to Miska_FL

Thanks...


But for Question #3, I meant "/Volume" literally.

In other words: /Volume/.metadata_never_index

so as to prevent indexing: /Volume/USBDRIVE1 and /Volume/USBDRIVE2


Note that the /Volume directory (folder) contains a link to the main system HDD (ie. Macintosh HD). I'm somewhat worried that if a /Volume/.metadata_never_index prevents EXT drives from indexing, it might also prevent the system hard drive from indexing...


This brings up another question:

I read somewhere, that OSX uses information in the .Spotlight-V100 folder to determine if indexing should occur. If this is the case, which comes first? The check for a .metadata_never_index file, or the configuration information found inside the .Spotlight-V100 folder? Perhaps it is the case that once indexing has been established (a .Spotlight-V100 folder exists), that it no longer checks for a .metadata_never_index file. Who knows? It's a tough experiment to run, because indexing does not occur instantaneously.

Oct 26, 2013 9:04 AM in response to cwebber1

I don't know if this will help any, but I have a number of external devices, each with multiple partitions, which I do not want indexed. The first time one gets plugged into my Mac Pro, Spotlight begins to do its thing, but when I add each partition of each drive to the Privacy panel, indexing stops. When those drives/partitions aren't connected, they don't appear in the list. But if I then reattach the external, the drives/partitions reappear in the Privacy list. I don't know if the Privacy listing status for those externals is retained locally or is present somewhere on each external, but those externals don't get indexed when they're attached. One hint to a solution may be that the exception to staying on the privacy list when connected is if I erase the partition with Disk Utility in preparation for making a backup clone (the name of the partition doesn't change). After being erased, the partition is no longer on the Privacy list and has to be added again, where it stays until the next erasure. This is with Lion. I'd assume it also works that way with ML and Mavericks, but you never know.

Oct 26, 2013 9:25 AM in response to FatMac-MacPro

Yes, that was helpful. Another piece to the puzzle. Thanks!


It's interesting that the listing in Privacy goes away when the volume is not attached. That would make managing 5 machines very difficult. It would suggest that I'd have to plug in each drive to each machine if I chose the Privacy method to prevent indexing.


Also noteworthy, is that the Privacy feature seems to simply use the logical name (path) to the folder. I would imagine that if you rename a USB Drive (on a different machine??) you might have to re-apply the privacy setting.


I feel that the appropriate place to put the "no index" information is on the HDD, because I want all of my computers to comply.


Another concern comes to mind:

Do all versions of OSX create and manage the .Spotlight-V100 database exactly the same way? If not, then there will likely be problems if you plug a thumbdrive or external HDD into two different machines running different versions of OSX. Yikes!

Oct 26, 2013 10:04 AM in response to cwebber1

Glad you found that helpful.


The Privacy listing for a given external only disappears when the external isn't attached; it reappears when it is attached so either a local record of "Don't Index" is only shown as necessary or, more likely, that record is on the external and is read as part of the mounting process when it's connected. While the process of putting each external on each Mac's Privacy list is a pain, it should only be necessary to do it once. Whether the Don't Index flag is Mac specific, so that Mac 1 doesn't want that external indexed but Mac 2 does, is another question.


I do think the Don't Index flag or file is separate from the partition's logical name because, when I erase the partition in preparation for a new backup clone, I don't change the name of the partition, and the name of the device to be cloned doesn't change either. Rather, it may simply be a Spotlight related file that gets erased along with everything else.


Fortunately, I don't have to worry about Spotlight; apart from the Privacy listing, I have all of the Search Results options unchecked, so there's very little to index on the boot partition. Spotlight can't be turned off altogether though because it interacts with the App Store regarding purchases and downloads. For finding things, I use EasyFind, which, while not able to find content in documents, looks inside of everything else, including Packages and hidden System files, and does it on demand without having to index anything. Another advantage of that is, by not tinkering with OS files, including those associated with Spotlight under the hood, when a new OS changes how things work, there's less risk of a deeply hidden self inflicted bug.

Mar 12, 2014 11:24 AM in response to Miska_FL

This was perfect for me. In Terminal, I nav'ed to /Volumes, and then for each of the mapped volumes that I don't want indexed, I did:


touch volumename1/.metadata_never_index

touch volumename2/.metadata_never_index


I then unmounted and remounted those drives, and when I opened Spotlight to search for something I know was on those volumes, there was no initial "Indexing volumename..." message at the bottom of the Spotlight menu.


Then, I wanted to confirm that no indexing was happening, so back in that Terminal window, again for each of those volume directories, I did:


mv volumename1/.Spotlight-V100/ volumename1/.Spotlight-V100-REMOVED

mv volumename2/.Spotlight-V100/ volumename2/.Spotlight-V100-REMOVED


After unmounting and remounting those drives, and again searching in Spotlight for files I know exist in those volumes, the original .Spotlight-V100 folders were not recreated.


I now have confidence that I can move this external drive and its volumes to any other machine and they won't be indexed there either because I'm not relying on my machine's Spotlight Privacy settings to inhibit the indexing.


Thanks Miska_FL for the answer, and cwebber1 for asking the original question.

Jul 7, 2014 12:27 PM in response to FourOhs

This is getting me closer to an answer, but I have another scenario.

I have a couple of external hard drives, (1TB and 2TB) that I use at home and at the studio. I want the drives to be indexed, as I use the search function quite a bit. Also, I use Pro tools which uses the spotlight indexes to find files under certain circumstances. I connect these external hard drives to different computers that have OS's from 10.6.8 all the way up to 10.9.

Once indexed on a particular OS, does it need to be re-indexed on another, or will all systems read the indexing? It's getting very tiresome watching the index slow down my computer all the time.

Thanks for any help

JJ

Disable spotlight for External Drives

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.