How To Prevent Spotlight From Indexing External Drives on MacOS
erics, Posted February 26th, 2021 at 11:46:15am
On MacOSX 10.10.5 Yosemite, I was having trouble with Spotlight preventing the clean eject of an attached hard drive.
Using the fuser
command allowed me to see that it what the Spotlight-specific mds
process preventing the eject.
1 |
fuser -u /Volumes/Archive03 |
At first, I tried to disable the indexing via the mdutil
command, but that just gave me an error:
1 2 3 4 |
shell> sudo mdutil -Ei off /Volumes/Archive03 /Volumes/Archive03: Error: unable to perform operation. (-400) Error: unknown indexing state. |
I ended up having to force eject the drive:
1 |
shell> diskutil unmountDisk force /Volumes/Archive03 |
The actual solution was so very simple, just create an empty file at the root of each external drive you with to prevent being indexed:
1 |
touch /Volumes/Archive03/.metadata_never_index |
ME said on June 29, 2021, 5:21 pm:
great quick answer, thank you