UPDATE: Since the release of OS X Lion, my blog is being frequented three times as often as normally. Especially this article seems to attract a lot of attention.
If you just updated to OS X Lion and your mds or mdworker (both parts of Spotlight) are running wild: don’t worry. It’s most likely that everything is OK. Spotlight needs to (re-)index a lot of stuff. Just let it work for a couple of minutes (maybe even hours). If mds/mdworker don’t calm down, come back here and read the following or this article.
Cheers.
END OF UPDATE
Just jotting down a few notes on what I found a couple of minutes ago…
I updated my iStatsMenus installation on my OS X 10.7 MacBook Pro to restore compatability with Apple’s new system and thus, for the first time in weeks, had all running processes viewable right underneath my nose.
I then saw that mds, the process that indexes the Volumes for spotlight, was running all wild and crazy at about 85-97% CPU usage for more than two hours.
Google didn’t help much and so I had a look at the logs (go to Applications, Utilities, then Console and filter for “mds”) and almost immediately found out what this was about:
mds was having some trouble with a “virtual” Volume, called “MobileBackups” . I didn’t research much further, but I guess this has to do with Lion’s ability to do local Time Machine backups…
Well, whenever I put a file into the trash, I could find errors like this in the log:
mds: (Error) Backup: Couldn’t stat source path ‘/Volumes/MobileBackups/Backups.backupd/Sebastian’s MacBookBook Pro/2011-06-04-084934/Macintosh HD/iSchack/.Trash/testtext.rtf’ — importing from backup path instead.
I decided to exclude /Volumes/MobileBackups from Spotlight (System Preferences -> Spotlight -> Privacy). And within a matter of seconds mds dropped from close to 100% CPU usage to about 10%. Now, 20 minutes later, it’s steady at 0,00% which is the way it should be.
Maybe this can help others, too…

Pingback: mds / mdworker running wild on OS X (10.6 AND 10.7) – again | SchackNetz