Macos – How to stop Spotlight indexing a networked Time Machine backup

macososx lionspotlighttime-machine

My Time Machine backs up to a hard drive connected to my Airport Extreme. After I've upgraded to Lion I have noticed that the mds process (the Spotlight indexer) has been running at 100% cpu every now and then. A simple file activity check told me that it was trying to index my Time Machine backup.

I have gone and added the Time Machine disk to the Privacy list in Spotlight settings, which is supposed to exclude the disk from the Spotlight index, but alas, Spotlight still tries to index it sometimes. Is it a bug in Lion or am I missing something?

Best Answer

There is a command line option Wheat;

$ mdutil 
Usage: mdutil -pEsa -i (on|off) -d volume ...
    Utility to manage Spotlight indexes.
    -p             Publish metadata.
    -i (on|off)    Turn indexing on or off.
    -d             Disable Spotlight activity for volume (re-enable using -i on).
    -E             Erase and rebuild index.
    -s             Print indexing status.
    -a             Apply command to all volumes.
    -V vol         Apply command to all stores on the specified volume.
    -v             Display verbose information.
NOTE: Run as owner for network homes, otherwise run as root

So on the Mac you need to:

$you@yourmac: mdutil -d /Volumes/YOURDRIVE [enter]
$you@yourmac: mdutil -E /Volumes/YOURDRIVE [enter]

Then you need to reboot (it seems that indexing does not stop until the Mac has been rebooted in some cases). The first line will disable the indexing, the second line should delete all of the index for that drive.

Related Question