Posted on 07-02-2012 08:58 AM
A few folks with 10.7 that were on-top-of upgraded from 10.6 are reporting spotlight isn't working; it offers no results.
Looking for ideas or warnings concerning offering a spotlight reset via Self Service. Has anyone had any experience with offering it to their users?
I am about to offer a policy that has the following Run Command:
sudo mdutil -E -i on /
At this point, I don't see the need to create a script.
Is there any pre or post steps I should be considering?
Posted on 07-02-2012 09:26 AM
That looks fine from where I'm sitting. If it were me the only difference I might do is make the users reboot after the command, just to be fully sure the Indexing will start up. I've seen rare occasions where even deleting the index and reenabling indexing doesn't kick it off, but it shouldn't strictly be necessary. I may also be thinking pre Lion. I think its more stable now.
Posted on 07-02-2012 09:28 AM
if you're running it via the "run command" field, you shouldn't need to preface with sudo. it's running as root already, no?
Posted on 07-02-2012 11:31 AM
Correct, Nate. The Casper admin account runs anything in that run command field (as well as scripts, I believe) with sudo rights.
Posted on 07-02-2012 11:59 AM
Yes, it does run as root, and therefore no need for the 'sudo' but in truth, having it in there does no harm that I've ever seen. It ignores the sudo since it doesn't need to escalate its own privileges. In other words, it works just the same either way as far as I can tell. If someone has proof otherwise, please correct me.
Posted on 07-02-2012 12:21 PM
while that's true, mike, i always cringe when seeing mac admins throw around sudo when it's not needed. just trying to reinforce good habits (of knowing what you're doing).
Posted on 07-02-2012 01:00 PM
Oh, I agree Nate. You're absolutely right. If its not needed, it shouldn't be there. I was just trying to point out that in this case, it isn't all that different than opening a sudo shell in Terminal and then doing a sudo command. Its unnecessary, but not dangerous or anything. At least as far as I know. Probably best to just leave it out though as you state.
Posted on 07-02-2012 04:03 PM
Does this ```
mdutil -E -i on /
``` accomplish the same thing as:
#!/bin/bash
# disable indexing of the root volume
mdutil -i off
echo "Indexing has been disabled"
# delete the Spotlight index
rm -R /.Spotlight-v100
echo "Index file has been deleted"
# reset the data cache for your Mac’s hard drive:
mdutil -E /
echo "Data cache has been deleted"
#re-indexing your hard drive
mdutil -i on /
echo "Re-indexing your hard drive"
/usr/sbin/jamf displayMessage -message "The Spotlight index has been reset for your computer. It may take a few hours to completely reindex your hard drive"
exit 0
in one line, and is the indexing stop unneccesary?
Posted on 07-02-2012 04:11 PM
rm -R /.Spotlight-v100
Is not necessary because because the -E flag will delete and recreate the index.
I don't believe it is necessary to stop spotlight before issuing the -E flag, but in some cases it is beneficial to stop spotlight from indexing to do work then re-enable it.
mdutil -E -i on /
That will delete and re-create the index on your root partition;
mdutil -E -a -i on
will delete and re-create the index on all drives, excluding network drives.
J.I.
Posted on 09-18-2012 08:15 AM
Just had this problem and i fixed this with the following two commands.......
sudo rm -i .metadata_never_index
sudo mdutil -E -a -i on