How can I start the mds process

Solution 1:

My guess is that it's launching, then crashing or erroring out in some form. Try sudo launchctl list com.apple.metadata.mds, and look at the PID (id of currently running process, probably 0 since it's not running) and LastExitStatus (which would be 0 if it exited successfully, but may be something else in this case). Also, look at /var/log/system.log (with either Console.app or 'tail') and see if it holds any clues. Also, look in /Library/Logs/CrashReporter for any relevant reports.

As for possible causes: if the logs don't tell you where the problem is, my first guess would be a broken mdimporter plug-in; I'd remove everything (temporarily) from /Library/Spotlight and ~/Library/Spotlight. Also, check /System/Library/Spotlight, and make sure these are the only mdimporters there:

Application Archives Audio Automator Bookmarks Chat CoreMedia Font Image MIDI Mail Notes PDF PS QuartzComposer RichText SystemPrefs iCal iPhoto iPhoto8 vCard

Another possible cause is a badly corrupted spotlight database. If removing suspect mdimporters doesn't get it started, try dismounting everything but the startup volume (& if that solves it, remount them one at a time and see which kills it). If that doesn't do it, try removing the existing spotlight database with sudo mv /.Spotlight-V100 /.Spotlight-V100-disabled (I'm not certain how thoroughly sudo mdutil -E / wipes out the old DB, but renaming it should force a full rebuild).

Solution 2:

The LaunchDaemon "com.apple.metadata.mds.plist" tells the system to run the following program: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/mds

Do you have that file on your system?

If so, you should check Console.app to see what error messages are being thrown (when the LaunchDaemon attempts to start it).

You should also compare the version of the following framework (note that it's one of the parent folders of the the mds file above) in Finder:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework

I'm running OS X 10.7.1, and my version (right-click the framework, and choose "Get Info") says 10.7.0

You might also be able to see if the system is attempting to launch it, by running "sudo newproc.d" in Terminal. This command should show you requests (including flags) to start processes, so you'll probably notice the "mds" command showing up there.

Solution 3:

must haves in your ~/.bash_aliases file.
or just use the ='CMD' at the terminal, as needed.

start/stop indexing on all volumes

alias spotlightoff='sudo mdutil -a -i off'
alias spotlighton='sudo mdutil -a -i on'

load / unload spotlight Launch Daemons.

alias spotlightunload='sudo launchctl unload -w \
 /System/Library/LaunchDaemons/com.apple.metadata.mds.plist'
alias spotlightload='sudo launchctl load -w \
 /System/Library/LaunchDaemons/com.apple.metadata.mds.plist'