Block Spotlight on a whole disk


Joined
Sep 25, 2015
Messages
212
Reaction score
2
I'd like to command Spotlight not to search a backup disk that has several partitions. The partitions get renamed with each backup according to the date (as in "backup 9-1-18", "backup 10-1-18"), so if I list those partitions in Spotlight "Privacy" those names will rapidly get incorrect.

So my disk is "LaCie d2 quadra Media". How do I block that whole thing, without referring to individual partitions? When Spotlight asks for disks to block, it wants Volume names, and a Volume name is a partition name.
 
Ad

Advertisements

Joined
Sep 17, 2014
Messages
4,855
Reaction score
237
In doing a google search regarding Spotlight, I found this:

"Spotlight is easily turned off using the terminal:
sudo mdutil -a -i off

This command stops indexing of ALL volumes:
sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"

This command removes the Spotlight index from main volume:
sudo rm -rf /.Spotlight-V100/*

The menu icon will still "be there", but after doing the above, Spotlight will no longer be lurking in the background."

I have always disabled Spotlight, as I use the excellent freeware program EasyFind for my searches. Also, I just tried that command "sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"", and it worked as expected.
 
Joined
Sep 25, 2015
Messages
212
Reaction score
2
Yes, thank you. I know how to disable Spotlight, and I have done that on another machine. The question here is how to disable Spotlight for ONE PHYSICAL DISK, that may have many volumes resident on it. It comes down to whether one can address a physical device, rather than a volume or partition. As in, don't index THAT ONE BOX. I'd like to have Spotlight working everywhere else.

It may be that physical devices simply don't have any real identities in the Mac OS.
 
Joined
Sep 25, 2015
Messages
212
Reaction score
2
I don't think that's the answer. When they say select "drives", they don't mean select "physical drives". They mean select "volumes" or "partitions" on a physical drive. As far as I can tell, my physical backup drive doesn't have any icon. The partitions/volumes on it all do. As I said, I want to tell Spotlight not to index anything on a particular drive. No matter what those volumes and partitions are named.

What Spotlight Privacy is offering to do is to not index particular named volumes. Not physical drives.

Again, the way it works is Spotlight Privacy will only ignore stuff on a physical drive if I tell it which volume/partition to ignore. So I can tell it to ignore volume/partion "A". But as soon as I rename the volume/partition "A" on that drive to "B", it will happily start indexing it.

I think the lesson here is that physical drives don't exist to MacOS. The only thing that exists are the volumes/partitions on them.
 
Joined
Sep 17, 2014
Messages
4,855
Reaction score
237
Well, if that's the restriction, I guess you'll need to do is 1) list the individual names (one would thin k there are not many of those), and 2) never rename any of them.

I actually do not have this issue at all, as in some manner (a long time ago) I stopped Spotlight from searching/indexing ANY of my drives/volumes/partitions (whether named or not). I know that was the case when I purchased 2 Samsung 512 gig 850 Pro SSDs about a year ago, installed them inside some nice, slim Orico enclosures, and Erased, Formatted., and Partitioned each of them (3 partitions each). Spotlight has never "touched" any of them since, nor both of my internal SSDs (I have 2 Macs). I tried some google searches about your issue, but whatever I have posted here is what I found out. Maybe you should try some Google searches on your own.
 
Last edited:
Ad

Advertisements

Joined
Sep 17, 2014
Messages
4,855
Reaction score
237
OK, I tried one more time with a google search of "How to block/prevent Spotlight from indexing ANY drive", and this link appeared:

http://osxdaily.com/2012/01/24/stop...-time-machine-backup-volumes-external-drives/

I know the first method is just like what I posted before. If the volume (ie, the name of the ENTIRE external drive) has a name, why would you change it? Also, whenever one gets a new (even used/refurbished) drive, it is always best to Erase, Format, and if necessary, partition it. Myself, whenever I have done that, I have always given the volume (ie, the entire drive) a name. As long as the drive works fine, I see no reason to change the volume name.
 
Joined
Sep 25, 2015
Messages
212
Reaction score
2
Thank you. I have done a lot of Google searches. That's why I'm here. I can probably work out a strategy for naming my backups that doesn't involve changing those names, but that's a bit inconvenient. It would be great if Spotlight Privacy could take wildcards, so I can ask it not to index "backup*", and it won't index anything named with "backup" as a prefix. That would be terrific. I believe Spotlight searches can use metacharacters, but it isn't obvious that Privacy can. You can't edit the name in Privacy, anyway. .

My reason for wanting this was specified in my OP. I name my backup volumes "backup_7/1/18", "backup_8/1/18", etc. I don't want to Spotlight search ANY of them. They are different backups. As to "the name of the ENTIRE external drive) has a name, why would you change it?", that's why.

No, please understand. "The name of the ENTIRE external drive" is NOT the name of the box. It's the name of a volume on that box. My disk drive is a box with wires coming out of it. I have separate volumes/partitions on that box that are treated as separate drives by the OS. But they aren't separate drives, as in, separate boxes. In Disk Utility, my backup drive box is called "LaCie d2 quadra Media". I can't find an icon associated with that name. Plenty of icons for each of the volumes/partitions on it, though.
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
8,904
Reaction score
342
Hello,

Can you upload a screenshot of the Disk Utility window, so we can see the partitions you are referring to? You can add individual partitions/physical volumes to the Privacy tab of the Spotlight preference pane. The LaCie d2 Quadra Media is a physical disk.

If you are using Time Machine, you cannot disable Spotlight for Time Machine backups/disks, due to the way it works. Let us know if you are using another application/method for creating the backups.

Hope that helps,

C
 
Joined
Sep 17, 2014
Messages
4,855
Reaction score
237
Corey's suggestion about providing a screen shot is a good one.

Also, I am trying to understand the naming/placement of each of your backups. My backup strategy is way easier, as I use SuperDuper!, and back up each of my Macs only once a week, and I do this to 2 external drives (the Samsung SSDs I mentioned above. The backup partitions on each of those drives have unique "Volume" names (that is. "Volume" is equivalent to "Partition"). And the new backup just replaces the prior one. Such a strategy is perfect for my situation. I can understand if your strategy is different.

From your description, it appears you are using Time Machine. Are each of your named backups written to separate "volumes" on the external LaCie drive?
 
Joined
Sep 25, 2015
Messages
212
Reaction score
2
Um, don't need screenshots. When Finder>Prefs is set to show external disks, all mounted volumes/partitions show up as separate icons. I can tell Spotlight not to index any of these individually, by name. They were created as disk partitions, and are each listed in /Volumes. I will call them partition/volumes.

I use SuperDuper as well, and do scheduled "Daily" and "Weekly" backups on another disk drive box. Each is a separate partition/volume. Two partition/volumes on one drive box. If I wanted Spotlight not to index those, that would be easy! Just tell it not to index the volumes named backup.weekly and backup.daily. BUT, I'm talking about a separate drive box that I manually do monthly backups to. As in, for my 9/1/18 backup, I power up the box, select the old backup.6/1/18 volume, write to it, and then relabel it backup.9/1/18. That way I KNOW when the monthly backup was done, and there are several monthly backups available on that drive/box. This is, as far as I'm concerned, an optimal backup strategy for me. I don't want to argue about optimal backup strategies.

This isn't about Time Machine. I don't use it.

What I want is for Spotlight to NOT grind and grind and grind on indexing my monthly backup when I plug it in and turn it on. That's what it does. If I tell it not to index backup.9/1/18, it will delightedly index backup.10/1/18 the next month. What I'm asking about, and I'm converging on understanding that there is no solution, is somehow telling Spotlight NOT to index "backup.*" (as in, all partition/volumes with a name prefixed by "backup") or, for that matter, any partition/volume on that disk/box. The only way I know how to do it is to turnoff Spotlight entirely, and I'm reluctant to do that for this machine.

I'm sort of explaining myself over and over with the same words, but I'm not sure y'all are understanding what I'm saying.

There is some ambiguity here. I call a box with a motor and a platter a "drive". Many people call a volume a "drive". But in the latter case, you can have many drives in what I call a drive. I want to tell Spotlight to not index anything in a particular box with a motor and a platter.
 
Last edited:
Ad

Advertisements

Joined
Sep 25, 2015
Messages
212
Reaction score
2
I should add that I'm wondering if

mdutil -i off /Volumes/backup*

would do what I want. That is, can a wildcard be used in mdutil on a mountpoint? That would be slick.

Oop. No. I tried it and get an "invalid path" error.
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
8,904
Reaction score
342
Just thought a screenshot may help, as it does in some cases...no worries.

As I understand it then, each box/drive you have as several partitions/volumes. You are using SuperDuper!, to select a partition/volume that has an older backup, updating it, then you are renaming it to the current date. You aren't using Time Machine.

So, the answer from my experience, is that you can manually drag each partition/volume to the Spotlight window when you rename it. Spotlight should stop indexing it, and not index it the next time you mount it. You will have to run SuperDuper!, rename it, then drag it into the Spotlight window again since the name changed. I haven't ever come across a way to use wildcards in partition/volume names with a Terminal command to prevent Spotlight from indexing. I also am not aware of any way to prevent Spotlight from indexing all the partitions/volumes on a drive/box, and even more so, because the names are changed each time.

Sorry we don't have an answer, but please post it here if you end up with a solution that works for your issue.

C
 
Joined
Sep 25, 2015
Messages
212
Reaction score
2
Thank you. Yes, it is extremely clear that I can make this all work by just updating Spotlight privacy every time I make a new volume/partition. The original question was whether there was an easier way to do it. I guess I find it a bit odd that the OS can't be commanded to function on a "drive" as opposed to a "volume" (by doing whatever is commanded on ALL volumes on the drive). It would be slick if you could assign volumes to a "class" of volumes, and act transparently on that whole class.
 
Ad

Advertisements

Joined
Sep 17, 2014
Messages
4,855
Reaction score
237
Of course, the easiest way is to turn off Spotlight entirely, like I have. I really do not need it indexing my drive (SSDs, in my case).

Also, your statement "I don't want to argue about optimal backup strategies" is inaccurate, and certainly inappropriate. Here is what I said above about backup strategies:

"And the new backup just replaces the prior one. Such a strategy is perfect for my situation. I can understand if your strategy is different."

Where does that say I want to argue about backup strategies? It seems VERY clear that I am saying the exact opposite.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top