View Full Version : How to prevent Spotlight from Indexing Backup Drives?

05-11-2007, 08:09 PM
Recently purchased an external drive and Super Duper, and am perplexed on how to prevent Spotlight from indexing my imaged drives on the external HD. I have gone to spotlight preferences, but when I drag the Ext drive images to the drop field, they are not added, nor when I use the + sign to add them.

Anyone found a solution to this issue?
Thanks all you gurus and people with opinions!

05-11-2007, 10:56 PM
Try erasing the drive with Disk Utility, then restart your Mac. Once restarted, see if it goes int the Privacy tab...

05-12-2007, 11:32 PM
I also found out how to then force spotlight to reindex my main HD via the terminal. Really pretty easy to do if others want to reindex, even for a novice--just make sure to do it from an administrator account, not a standard user account.

05-13-2007, 09:05 AM
(For those who don't know, it's

sudo mdutil -E -p "/Volumes/the-volume-you-want-to-index").

05-17-2007, 11:18 AM
Should I care if Spotlight re-indexes my backup drive (it is doing this)?
If not, should I let the re-indexing complete before I backup?
How about when I use my backup drive to bring my vacation home Mac up-to-date?

05-17-2007, 11:25 AM
I'd certainly add the backup into Privacy. Not quite sure what you mean about your vacation Mac -- you mean Spotlight?

05-17-2007, 11:34 AM
I'd certainly add the backup into Privacy. Not quite sure what you mean about your vacation Mac -- you mean Spotlight?

I have 2 iMacs in 2 houses. I backup my main machine into an external HD, using SD. When I go to my vacation home's iMac, I boot from the external and "back up" so to speak, to the iMac there, in effect, bringing both iMacs and the external to the identical state at that moment. Then I run from the iMac and shut off the external.

When I'm ready to return home, I back up the vacation iMac that I've been using, to the external, and then copy IT back into the main iMac upon my return.

I guess I don't understand "Privacy." I'll have to look into that.
OK, I found it. I dragged the external into the window, and I suppose that's that.

05-17-2007, 11:47 AM
Yep, that's that!

05-24-2007, 03:06 PM
For me, it's not that. Spotlight keeps reindexing my backup drive, and it's really annoying.

It doesn't happen all the time. Maybe once out of every five backups. I plug the drive in, turn it on, and then it starts grinding away as Spotlight tries to create its index.

I have to turn it off, otherwise the backup will take forever if I try to backup to that drive while Spotlight is indexing it. I have no problem adding the drive to Spotlight's privacy list, and as soon as I do that it immediately stops indexing, and I can proceed with my backup.

But I have to keep doing that, over and over. Spotlight seems to occasionally forget that I don't want it to index this drive. Why?

05-24-2007, 03:32 PM
I don't know, Khuzud: it could be a bug in Spotlight. Are you running OSX 10.4.3 or later?

05-24-2007, 05:05 PM
Yes, this is OS X 10.4.9, running on a 15" Powerbook G4. I'm backing up to a drive over USB2.

05-24-2007, 05:10 PM
Unless there was some kind of error, I can't think of any reason, under 10.4.9, why your Spotlight "privacy" state wasn't retained over a restart or unplug/plug.

05-25-2007, 08:57 PM
I just updated my backup drive to find Spotlight indexing the drive even when I had it in the Privacy tab, it's not listed there anymore and I couldn't add it. Looking around the net I found Spotlight tips (http://www.thexlab.com/faqs/stopspotlightindex.html#Anchor-Preventing-49575) I haven't tried it yet but I will the next time I create a backup.

06-11-2007, 06:22 PM
Thanks for the pointer to that website. Using the information there I think I've fixed my Spotlight problem.

I created a shell script with the line:

defaults write /Volumes/Backup/.Spotlight-V100/_IndexPolicy Policy -int 3

Then I set SuperDuper to run that script after completing the backup, using the advanced options.

I haven't had a problem with Spotlight indexing my backup drive since then.

06-12-2007, 03:27 PM
Spotlight always forgets the "Privacy" setting after awhile.

What I do is set up the backup to run later, then unmount the external drive from the Finder but leave it attached. SD seems to be smart enough to mount a dismounted drive. When the backup is finished it should unmount the drive. At least that's how I do it... seems to work.

06-23-2007, 02:03 PM
The latest version of SuperDuper! is supposed to restore the Spotlight status, but it doesn't always work. I think the problem is that it is too dependent on the Spotlight Privacy tab.

I have indexing disabled on my backup volume via mdutil -i off. Before running SuperDuper, the backup volume has file .Spotlight-V100/_IndexPolicy.plist, with Policy value 3.

As soon as SuperDuper! starts the backup, all of the files in .Spotlight-V100 are erased.

At the end of the backup it says it is restoring the Spotlight status, but .Spotlight-V100 remains empty.

What this means is that the next time I mount this volume, Spotlight is going to start indexing it.

06-23-2007, 02:23 PM
If you use the Privacy tab, it should work properly. Remember: indexing off is not the same as privacy: privacy also avoids searching the drive.

06-23-2007, 02:34 PM
If you use the Privacy tab, it should work properly. Remember: indexing off is not the same as privacy: privacy also avoids searching the drive.But that is just the problem... I want to be able to search the drive with Find. I just don't want Spotlight to index it.

So I followed the instructions at this site: http://www.thexlab.com/faqs/stopspotlightindex.html

I'm going to try the disable_spotlight post backup shell script and see how that works for me.

06-23-2007, 02:44 PM
OK; should work fine.

06-24-2007, 01:40 PM
What is the post-backup spotlight script you’re referring referring to? I have exactly the same problem. While I would expect a function in SD to handle this and hate the fact that I have to scout forums and go into the depths of terminal programming... I reckon there’s no way around. Indexing even starts while copying, which brings my system to a halt. Literally.

06-24-2007, 01:43 PM
It's in the Frequently Asked Questions section.

06-24-2007, 02:00 PM

Thanks for the swift reply. It might be time to rewrite the FAQ on this. I found it, however:

>As of v2.0, when used with Tiger 10.4.3 or later, it's quite easy: just add the volume to the Privacy tab of the Spotlight preference pane. We'll automatically ensure that that state is maintained, and all should work fine.

Nope, doesn’t work. Been there, done that. SD doesn’t ensure that the state is maintained. Read above posts and you’ll see I’m not alone with this observation.

>Now, open SuperDuper! In Options, there's a selection for a "Site Customization Script". Check the box, and select the "disable_spotlight" executable in the open panel.

Again, time for a rewrite. In version 2 this section does not exist! Do I run the script BEFORE or AFTER a copy?

06-24-2007, 02:20 PM
While I recognize that there are some users on this thread having trouble with Privacy, it does work in my testing. If the copy fails, there could be problems, but otherwise it should work.

You run the script as an after copy script.

06-25-2007, 06:15 PM
Add me to the list of folks who has this problem. Mutliple times, with multiple drives. All works fine at first and then the drive disappears from the Privacy list in Spotlight.

I even bought Spotless hoping it would fix the problem, but _it_ was overriden somehow and the backup volume shows up in Spotlight searches.

I used to use the script pre-2.0 so I'll go back to it.

06-25-2007, 08:38 PM
While I recognize that there are some users on this thread having trouble with Privacy, it does work in my testing. If the copy fails, there could be problems, but otherwise it should work. That's my experience. It works fine except when I stop a backup before SuperDuper restores my privacy settings. In response, when I cancel a backup, I go to Spotlight's preferences to ensure that the backup drive is still in the privacy tab. If I'm feeling particularly paranoid, I eject the backup drive and remount it before checking Spotlight's privacy tab.

Would it be feasible to restore the privacy setting when quitting an incomplete backup?

Here's a hint: If Spotlight indexes the apps on your backup drive, the "Open With" menu may double up for each app even after you restore the backup drive to Spotlight's privacy tab. Here's the command to fix that up: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -f -domain local -domain system -domain user "/Applications" I always reboot immediately afterwards, but I'm not sure that's necessary.

06-25-2007, 08:43 PM
It's something we're looking at... there are some complexities involved.

07-01-2007, 07:34 AM

You tend to assume that when things work for you with SD they should work for other people too. I think, especially for a developer of quality software, you should rethink this point of view.

I’ve added the shell script from the FAQ section to my schedule in SD and it just ran for the first time after backup had completed. Right now, my drive is busy with indexing. Again. So much for that solution to the problem.

As mentioned above, adding a drive to the privacy tab doesn’t help either as Spotlight seems to forget about this once SD has used the drive for a backup. I certainly feel - and have all the time - that this is an issue/bug with SD and not Spotlight.

07-01-2007, 07:48 AM
gryphonent, I have an idea on what the problem may be, as I had difficulty getting shell scripts to run with scheduled backups too. After you add the shell scripts to your advanced options, you have to recreate your scheduled backups for them to "stick" as part of the scheduled activity.

Edit to add: Ooops! I just noticed that you mentioned that the shell script did indeed run after the backup. Never mind! My next wild-a$s guess is some sort of problem passing a parameter from SD to the shell script. It's a simple one: #!/bin/sh
echo "Disabling spotlight for $4..."
mdutil -E -i off "$4"

07-01-2007, 08:02 AM
It's not so much that I feel it should work the way it should work for me, but rather than it should work as it does in our testing, which crosses a lot of different users and machines.

There's a definite issue in SD! where a backup fails, where it doesn't restore the spotlight state. We know about that. But when a Spotlight volume doesn't go into Privacy, that's something else, and much more an issue with Spotlight...

07-01-2007, 03:33 PM
The volume can be dragged into the privacy tab... however, once SD completes the next backup it “disappears” from the list.

07-01-2007, 04:10 PM
Unfortunately, I've never seen this happen here, and can't think of any reason it would other than what I've mentioned elsewhere. If I can't reproduce the problem, or logic put a reason why it might happen, it's really difficult to come up with any kind of fix.

That doesn't mean I wouldn't like to fix it: it simply means I'm unable to right now.