Victory! After years of being somewhat irritated about the mdsworker and mds process running in the background and causing my fan to go on sometimes, I finally decided to do something about it. I never use Spotlight anyway so why not get rid it that and save some CPU cycles? There are many suggestions and tricks out there to disable Spotlight on Mac OSX, but most of them didn't make sense to me or didn't do exactly what I wanted when I tried them. The solution that I settled on here is the most effective, reversible, and safest in my opinion.
First a little background about OSX. When your mac boots up, it runs several property-list files (*.plist) via
launchd, a unified, open source service management framework for starting, stopping and managing daemons, applications, processes, and scripts. So if we don't want Spotlight to start up and we don't want the mds process to index your drive(s), all we need to do it prevent launchd from starting the plist files that start these processes.
Here's how you do that (tested on Mac OSX Leopard 10.5)...
Spotlight
Open up Terminal, and run the command:
sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.Spotlight.plist
MDS, MDSWORKER
In Terminal, run the command:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Spotlight's Index Files
To get rid of Spotlight's files run the following command in Terminal:
sudo rm -r /.Spotlight-V100
Getting Spotlight back
If you change your mind after diabling Spotlight, all you need to do to start it again is to run the following commands in Terminal:
sudo launchctl load -w /System/Library/LaunchAgents/com.apple.Spotlight.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Piece of Cake!!!
**Disclaimer - Use at your own risk. And remember, don't believe everything you read on the Internet! :)
References:
launchctl