16

I have a 2TB external drive I use for Time Machine. At random intervals, it will decide to spin up and my entire UI freezes until it's finished. This is incredibly annoying.

It appears that this is due to Spotlight indexing. They suggest adding the Backup drive to Spotlight's blacklist, so I did:

fffffffuuuuuuuuu

Am I stuck having to live with constant beach ball attacks?

Update: I've already tried mdutil. It doesn't work.

$ sudo mdutil -E -i off /Volumes/Backup/Backups.backupdb/
Password:
/Volumes/Backup/Backups.backupdb:
    Indexing enabled.

If it's impossible to disable indexing, I would settle for making the backup drive never spin down.

  • "Your entire UI freezes" doesn't sound right. It's true that anything that accesses the drive will have to wait for it to spin up, but the Spotlight indexer is a background process which the UI shouldn't be waiting for. Is it possible that there is something other than Spotlight which is using the drive? – Kevin Reid Dec 3 '11 at 17:52
  • @Kevin I agree, it makes no sense. But it isn't limited to any particular app, and frequently occurs when doing something that has nothing to do with the backup drive whatsoever. The drive simply decides at random intervals that it needs to spin up, and whatever I am doing freezes until it completes. – Adam Lassek Dec 6 '11 at 1:41
  • Did you (or anyone else) ever find a solution to this problem? – Hemm Oct 16 '14 at 19:02
  • @Hemm no, I had to resort to ejecting the drive when I wasn't backing up to keep it from freezing my UI. Pretty lame. – Adam Lassek Oct 19 '14 at 3:25
  • see also superuser.com/questions/325005/… (but it looks like that it is just not possible to disable indexing on Backups.backupdb ?!) – Andre Holzner Sep 24 '17 at 15:32
4

Apply it to the volume, not a directory:

sudo mdutil -i off /Volumes/TimeMachine/

Substitute TimeMachine with the name of your backup volume, of course. For example...

Johns-iMac:~ john$ sudo mdutil -i off /Volumes/Time15/
Password:
/Volumes/Time15:
2015-10-27 12:37:18.436 mdutil[56686:26121199] mdutil disabling Spotlight: /Volumes/Time15 -> kMDConfigSearchLevelFSSearchOnly
    Indexing and searching disabled.

Which does leave the subdirectory reporting as "enabled", but (until proven wrong I understand) the setting at the volume level will override.

4

Create an empty file on the root of that drive, named .metadata_never_index. This Mac OS X Hints article says more.

  • 2
    Did you try it? Because mdutil says Backups.backupdb is still being indexed. – Adam Lassek Oct 29 '11 at 0:15
  • Yes. On a flash drive, a camera flash-card and two .dmgs. It works on all of them. – JRobert Oct 30 '11 at 0:15
  • 1
    it appears that Time Machine backups are a special case. – Adam Lassek Oct 31 '11 at 18:34
  • sudo touch /Volumes/<external disk>/.metadata_never_index (after disabling indexing for the disk as a whole) in fact made my time machine progress beyond the few kilobytes it was stuck four hours before. Even though when doing sudo lsof | grep <external disk>' I still see processes mds` and mds_store having open files on the external disk in .Spotlight-V100/Store-V2... – Andre Holzner Sep 24 '17 at 16:00
2

Do it from Terminal via sudo (info courtesy this page):

sudo mdutil -a -i off

You'll also need to supply your admin password.

Similarly, to turn back on:

sudo mdutil -a -i on

Note: Set the items for Spotlight to show at Prefs > Spotlight

  • 2
    You probably should include a command for turning it back on. – daviesgeek Oct 28 '11 at 21:14
  • 2
    mdutil also refuses to turn off Time Machine indexing. – Adam Lassek Oct 28 '11 at 21:15
  • @daviesgeek, good point - I thought it would be reasonably obvious (and was covered in the article) – JW8 Oct 28 '11 at 21:18
  • You shouldn't turn spotlight off for your main drive unless you know the consequences, such as App Store upgrades will never work again, email searches won't work (if using Apple Mail), etc. Spotlight is a real nuisance but required by the OS for a number of things. – kakubei Sep 10 '13 at 14:49
2

I finally found you cannot disable Spotlight to index Backups.backupdb.

Apple Support. OS X El Capitan: Spotlight preferences

If you add a Time Machine backup disk to the privacy list, you will continue to see messages that Spotlight is indexing your backup disk. This indexing is necessary for Time Machine to function properly and can’t be disabled. Spotlight does exclude from searches any items you store on your backup disk that are not part of a Time Machine backup.

0

Time machine requires spotlight indexing activity, but the contents will not pollute search results. If the goal is to remove redundant search results for a non-Time Machine drive (a CarbonCopyCloner backup for example) then the volume can be simply added to the privacy list under Spotlight preferences.

(The details of the original question indicate it is about Time Machine, but I include this case for those who find this question by the title.)

-1

Here's the man page for mdutil:

mdutil(1)                 BSD General Commands Manual                

NAME
     mdutil -- manage the metadata stores used by Spotlight

SYNOPSIS
     mdutil [-pEsav] [-i on | off] mountPoint ...

DESCRIPTION
     The mdutil command is useful for managing the metadata stores for mounted volumes.

     The following options are available:

     -p  Spotlight caches indexes of some network devices locally.  This option requests that a local
         caches be flushed to the appropriate network device.

     -E  This flag will cause each local store for the volumes indicated to be erased.  The stores will
         be rebuilt if appropriate.

     -i on | off
         Sets the indexing status for the provided volumes to on or off.  Note that indexing may be
         delayed due to low disk space or other conditions.

     -s  Display the indexing status of the listed volumes.

     -a  Apply command to all volumes.

     -v  Print verbose information when available.

I would use:

mdutil -E -i off [the mountpoint for your backup drive]
  • 3
    I've already stated that mdutil leaves Backups.backupdb enabled no matter what. Did you try it? – Adam Lassek Oct 29 '11 at 0:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .