Is Spotlight taking up space on your Mac? How to check and rebuild it
Spotlight keeps an index of your files so search is instant. Usually it's a few gigabytes; occasionally it grows far larger. Here's how to check, rebuild or shrink it.
Spotlight keeps an index of your files so search is instant. Usually it's a few gigabytes; occasionally it grows far larger. Here's how to check, rebuild or shrink it.
Each indexed volume has a hidden .Spotlight-V100 folder at its top level. On your startup disk it's at /System/Volumes/Data/.Spotlight-V100; external drives have their own. The folder is protected, so you'll only see its size with administrator rights — in DiskGarden, scan as administrator.
An index of a few gigabytes is normal for a full disk. Much more than that, or an index that keeps growing, can mean it's damaged.
In Terminal, mdutil -s / shows whether indexing is on for your startup disk. While Spotlight is (re)indexing, you'll see the mds and mds_stores processes busy in Activity Monitor.
If search misbehaves or the index looks far too big, erase and rebuild it:
sudo mdutil -E /
Spotlight rebuilds the index in the background; search results are incomplete for a while (from minutes to a few hours on a big disk).
Folders with huge numbers of files you never search — build output, package caches, VM images — make the index bigger for no benefit. Add them to Spotlight's Search Privacy list in System Settings → Spotlight.
To stop indexing an external drive entirely: sudo mdutil -i off /Volumes/DriveName.
DiskGarden is a free disk space analyzer for Mac: it maps every folder by size, so the space hogs stand out. No account, and your files never leave your Mac.