Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Spotlight doesn't reindex - can it be forced via terminal?

Spotlight doesn't reindex - can it be forced via terminal?
Thread Tools
Fresh-Faced Recruit
Join Date: Jul 2005
Status: Offline
Reply With Quote
Jan 6, 2007, 09:12 AM
 
As a follow up to my earlier post, I made an effort to get Spotlight to re-index.

I dragged a folder over to the privacy window. When I let go of the mouse button to drop it, it doesn't stay there. Similarly trying to add a folder or drive with a "+" doesn't work either.

So I went ahead and upgraded to 10.4.8.

No change. SPOTLIGHT IS DEAD.

Anyway to force the reindex?
     
Mac Elite
Join Date: Sep 2005
Location: Los Angeles, California
Status: Offline
Reply With Quote
Jan 6, 2007, 11:57 AM
 
Yes.

Quick google search, however, doesn't yield anything.

Sorry
Linkinus is king.
     
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Jan 6, 2007, 01:29 PM
 
This is for the boot volume ( / ):

sudo mdutil -i off /
sudo mdutil -E /
sleep 7
# whatever
sudo mdutil -i on /

# go eat breakfast (let drive index for about an hour)

Use "/Volumes/name of volume" for non-boot volumes.
-HI-
     
Senior User
Join Date: Jul 2003
Location: Asia
Status: Offline
Reply With Quote
Jan 6, 2007, 01:29 PM
 
Originally Posted by butchfoote View Post
Anyway to force the reindex?
Spotless 1.2.1 – Mac OS X – VersionTracker

"Spotless allows you to delete existing Spotlight indexes. This will free up the space used by the index files on volumes that are no longer being indexed. You may also delete indexes on volumes that are being indexed. This will cause Spotlight to reindex the volume - especially useful if your index becomes damaged."

Shareware but free trial allows most functions.
     
Fresh-Faced Recruit
Join Date: Jul 2005
Status: Offline
Reply With Quote
Jan 6, 2007, 04:02 PM
 
Originally Posted by Hal Itosis View Post
This is for the boot volume ( / ):

sudo mdutil -i off /
sudo mdutil -E /
sleep 7
# whatever
sudo mdutil -i on /

# go eat breakfast (let drive index for about an hour)

Use "/Volumes/name of volume" for non-boot volumes.
I tried this and got a message:

Could not set indexing status for volume.

What in the world is going on ????

Thanks again for your time and advice.
     
Mac Elite
Join Date: Jan 2001
Location: Kansas City, Mo
Status: Offline
Reply With Quote
Jan 7, 2007, 11:24 AM
 
You can use Onyx. It is free and does some other maintenance things for you as well.

OnyX 1.7.8b1 - MacUpdate

or the scaled back version of Onyx (just the maintenance items)

Maintenance 1.0.9 - MacUpdate
(Last edited by kcmac; Jan 7, 2007 at 02:49 PM. (Reason:added maintenance))
     
Fresh-Faced Recruit
Join Date: Jul 2005
Status: Offline
Reply With Quote
Jan 7, 2007, 08:02 PM
 
I tried Onyx. There's one maintenance function to reset the Spotlight index to force a re-index. I executed it.

Nothing happened. Onyx's Help files suggest running Spotlightindexer to reindex the files. Theoretically, Spotlightindexer produces a log file that will show you which files or folders cause an indexing operation to stop. Then you can fix the file or delete it.

Spotllighter didn't produce any log file.

This seems hopeless.

Doesn't anyone know how to just put all of the pieces of Spotlight back to the out of the box state?

Thanks again to everyone for their help and suggestions!
     
Senior User
Join Date: Jul 2003
Location: Asia
Status: Offline
Reply With Quote
Jan 7, 2007, 09:41 PM
 
Originally Posted by butchfoote View Post
This seems hopeless.

Doesn't anyone know how to just put all of the pieces of Spotlight back to the out of the box state?

Thanks again to everyone for their help and suggestions!
Have you tried Spotless? It would seem to offer exactly what you need and the trial version is free and offers nearly all functions.

"Spotless allows you to delete existing Spotlight indexes... You may... delete indexes on volumes that are being indexed. This will cause Spotlight to reindex the volume - especially useful if your index becomes damaged.

If you are having difficulties with Spotlight indexing, it could be because the ".Spotlight-V100" directory on the volume has become damaged in some way. Spotless provides a quick way to delete this directory and set the initial indexing status of the volume. In order to set the indexing status, the ".Spotlight-V100" directory will be recreated.

Spotless will automatically find and delete the "mds-crash-state" file from selected volumes. The file may be created if the Metadata Server crashed or was unexpectedly closed during the indexing process. The presence of this file can prevent Spotlight from indexing the volume in the future."
(Last edited by rjt1000; Jan 7, 2007 at 09:53 PM. )
     
Mac Elite
Join Date: Jan 2001
Location: Kansas City, Mo
Status: Offline
Reply With Quote
Jan 7, 2007, 09:48 PM
 
Can you make it work in a guest account?

or similar to Hali's solution above.
https://www.math.ohio-state.edu/wiki...tlight_cmdline

or another method

macosxhints.com - Fix message counts and 'ghosts' in Mail's smart mailboxes
- Quit Mail
- Backup ~/Library/Mail/ in case anything goes wrong.
- Delete ~/Library/Mail/Envelope Index
- Relaunch Mail
- Hit OK to any message about reimporting messages
(Last edited by kcmac; Jan 7, 2007 at 10:15 PM. )
     
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Jan 8, 2007, 01:08 AM
 
Originally Posted by butchfoote View Post
Could not set indexing status for volume.
What does this one return then?
grep -i spot /etc/hostconfig

Also, look at the index folder...
sudo ls -aol /.Spot*

...and maybe think about using rm on those database (.db) files,
and trashing ~/Library/Preferences/com.apple.spotlight.plist too.

Or try that Spotless utility I guess... but maybe something really
subtle/tricky has gone funky, and a reinstall would be needed.

::shrug::
-HI-
     
Fresh-Faced Recruit
Join Date: Jul 2005
Status: Offline
Reply With Quote
Jan 8, 2007, 07:16 AM
 
Here's what I got .... looks like an index is there ....

drw------- 8 root admin - 272 Apr 7 2005 .
drwxrwxr-t 43 root admin - 1564 Jan 6 15:45 ..
-rw------- 1 root admin - 0 Jan 3 22:30 .journalHistoryLog
-rw------- 1 root admin - 28266496 Jan 3 22:30 .store.db
-rw------- 1 root admin - 56623104 Jan 3 22:30 ContentIndex.db
-rw------- 1 root admin - 238 Apr 7 2005 _IndexPolicy.plist
-rw------- 1 root admin - 378 Apr 7 2005 _rules.plist
-rw------- 1 root admin - 28266496 Jan 3 22:30 store.db

Interesting that there are two store db's with and without the .

Thanks
     
Fresh-Faced Recruit
Join Date: Jul 2005
Status: Offline
Reply With Quote
Jan 8, 2007, 07:29 AM
 
Spotlight=-yes-
     
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Jan 8, 2007, 03:40 PM
 
Originally Posted by butchfoote View Post
Here's what I got .... looks like an index is there ....

drw------- 8 root admin - 272 Apr 7 2005 .
drwxrwxr-t 43 root admin - 1564 Jan 6 15:45 ..
-rw------- 1 root admin - 0 Jan 3 22:30 .journalHistoryLog
-rw------- 1 root admin - 28266496 Jan 3 22:30 .store.db
-rw------- 1 root admin - 56623104 Jan 3 22:30 ContentIndex.db
-rw------- 1 root admin - 238 Apr 7 2005 _IndexPolicy.plist
-rw------- 1 root admin - 378 Apr 7 2005 _rules.plist
-rw------- 1 root admin - 28266496 Jan 3 22:30 store.db

Spotlight=-yes-
You mean "SPOTLIGHT=-YES-" right? (all caps).
Anyway, that much _looks_ fine to me (though, all items in my /.Spotlight-V100
folder belong to the 'unknown' group, not 'admin'... for whatever that's worth).

idunno

Could throw a few more Terminal commands at you
but I don't know where that will get us, if anywhere:

mdimport -L

ls -aol /usr/bin/md*

ls -aol /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support

sudo mdutil -s /

sudo lsof -c md


Did Spotless manage to do anything for you?
-HI-
     
Fresh-Faced Recruit
Join Date: Jul 2005
Status: Offline
Reply With Quote
Jan 10, 2007, 07:04 PM
 
Thanks for you suggestions.

This afternoon, I was curious as to how many files were in the system that seemed related to mds and I got a good list of them ((I had to use EasyFind), many of which are in the private folder on my boot drive.

I found these interesting.

/private/var/tmp/mds/501/mdsObject.db
/private/var/tmp/mds/501/mdsDirectory.db
/private/var/tmp/mds/501/mds.lock
/private/var/tmp/mds
/private/var/tmp/mds/system/mdsObject.db
/private/var/tmp/mds/system/mdsDirectory.db
/private/var/tmp/mds/system/mds.lock

The top set of files mds/501 have a last modified date that is one minute later than the mds/system files. The time stamp is on the day that I believe that my problem occurred.

If you look at your system do you and everyone else have these two sets of files.

Many thanks! I'll try the other suggestions above tomorrow.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:00 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2