0

Spotlight decided to index my external hard drive that I use for backups without asking my permission.

This made it impossible for me to safely eject the external hard drive without potentially corrupting the file system.

enter image description here

I have successfully stopped spotlight from indexing it again in the future by adding the external disk to the "DO NOT INDEX" list in "System Preferences > Spotlight > Privacy".

enter image description here

So now Spotlight no longer interferes with my ability to eject my external hard drive.

However, I am showing a lot of files as still being opened on the external hard drive:

 😈   >sudo lsof | grep /Volumes/Backup/
Password:
mds        59            root   27r      DIR                1,7      2856                 107 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404
mds        59            root   30u      REG                1,7         0                 152 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/journalExclusion
mds_store 183            root  txt       REG                1,7      3277                 117 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/0.indexGroups
mds_store 183            root  txt       REG                1,7         8                 119 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/0.indexTermIds
mds_store 183            root  txt       REG                1,7         8                 123 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/0.indexCompactDirectory
mds_store 183            root  txt       REG                1,7         8                 116 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/0.indexIds
mds_store 183            root  txt       REG                1,7         8                 121 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/0.indexPositionTable
mds_store 183            root  txt       REG                1,7      2056                 122 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/0.indexDirectory
mds_store 183            root  txt       REG                1,7        64                 124 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/0.indexArrays
mds_store 183            root  txt       REG                1,7     32768             4215456 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.2.indexCompactDirectory
mds_store 183            root  txt       REG                1,7    419431                 128 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.0.indexGroups
mds_store 183            root  txt       REG                1,7    131584             4215455 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.2.indexDirectory
mds_store 183            root  txt       REG                1,7    419431             4215448 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.2.indexGroups
mds_store 183            root  txt       REG                1,7    838861             1460612 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.1.indexGroups
mds_store 183            root  txt       REG                1,7   2955200                 127 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.0.indexIds
mds_store 183            root  txt       REG                1,7   7593836             2418144 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.0.indexDirectory
mds_store 183            root  txt       REG                1,7   7993368             1460611 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.1.indexIds
mds_store 183            root  txt       REG                1,7   4194304             4215447 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.2.indexIds
mds_store 183            root  txt       REG                1,7  10989320             4617084 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.1.indexDirectory
mds_store 183            root  txt       REG                1,7  68946622             2418145 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.0.indexCompactDirectory
mds_store 183            root  txt       REG                1,7 280164544             2418146 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.0.indexArrays
mds_store 183            root  txt       REG                1,7  66644118             4617085 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.1.indexCompactDirectory
mds_store 183            root  txt       REG                1,7 283469632             4617086 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.1.indexArrays
mds_store 183            root  txt       REG                1,7  33554432             4215451 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.2.indexTermIds
mds_store 183            root  txt       REG                1,7  33554432             4215453 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.2.indexPositionTable
mds_store 183            root  txt       REG                1,7  67108864             4215457 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.2.indexArrays
mds_store 183            root    6r      DIR                1,7      2856                 107 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404
mds_store 183            root   16r      DIR                1,7      2856                 107 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404
mds_store 183            root   59u      REG                1,7        28                 114 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/indexState
mds_store 183            root   63u      REG                1,7  67108864             4215457 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/live.2.indexArrays
mds_store 183            root   64u      REG                1,7  76926976                 138 /Volumes/Backup/.Spotlight-V100/Store-V2/CE09E80F-C475-425F-B3AC-62F6D4C01404/.store.db

I am worried about this because Spotlight previously corrupted the file system on my external hard drive and I lost a years worth of backups.

So it would really set my mind at ease if there was a way to clean up these open files and perhaps ensure the integrity of the file system on my external disk.

Is this possible?

1

These files are open because Spotlight is indexing your Time Machine backup. Sadly this is now a requirement in El Capitan, which one presumes you are running:

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.

I find that this Spotlight indexing slows down the ability to stop an in-progress backup and eject the external disk.

You must log in to answer this question.

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