Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.4: Force Spotlight to reindex a drive System 10.4
Tiger only hintAfter mounting an external FireWire volume onto my desktop, I noticed the Spotlight icon in the right uppermost corner of my screen pulsing. Upon clicking on the icon, it told me that it was indexing the drives.

Following the indexing process' completion, I began using Spotlight to search for content on the drives. To my dismay, many files were missing. This included media, system, and other files and folders. The only way to get Spotlight to show them was to either open or edit each missing file/folder.

After studying resources around the web, I discovered that every volume contains its own Spotlight index (making perfect sense). Through closer inspection, each drive contains a file in its root named .Spotlight-V100. This is that index file.

If this file is removed from the root, and the drive is ejected and mounted, Spotlight will once again index the offending drive, creating a new .Spotlight-V100 file. This was able to fix my missing file/folder hiccup. Enjoy.
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[88,065 views]  

10.4: Force Spotlight to reindex a drive | 26 comments | Create New Account
Click here to return to the '10.4: Force Spotlight to reindex a drive' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.4: Force Spotlight to reindex a drive
Authored by: saxphile on Fri, Apr 29 2005 at 10:05PM PDT
You can also use the command line app mdutil to do the same thing. Although either way you'd have to know something about running commands in Terminal.

For example: sudo mdutil -E /

[ Reply to This | # ]
Can I force Spotlight to index my server volume(s)?
Authored by: ratzfatz on Sat, Apr 30 2005 at 5:58AM PDT
This was in fact the reason why I bought Tiger. Am pretty disappointed not being able to search for content on a server volume. Wouldn't mind to leave one workstation running overnight just for doing the indexing.

Indexing a FW drive is possible though. Great! Concerning speed I believe my gigabit network being somewhat more effective compared against FW 800, let alone FW 400.

Any solution out there?

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: danielj7 on Fri, Apr 29 2005 at 10:32PM PDT

You can also do this from the command line with the mdutil command. Launch Terminal and enter:

sudo mdutil -E /

and the index file will be erased and rebuilt. The "/" stands for the boot volume; you can substitute the pathname of any volume here.

Substitute "-s" for "-E" to show if indexing is enabled on the volume, and "-i on" or "-i off" to enable or disable indexing. Note that mdutil must be run as root; hence the sudo.

You can also use mdimport to index a subset of files:

mdimport ~/Documents

would index your Documents folder and

mdimport -r /Library/Spotlight/AppleWorks.mdimporter

would index all AppleWorks files on your computer.

mdimport -L

will list all installed metadata importers.



[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: fuzzy_logic on Fri, Apr 29 2005 at 11:53PM PDT
For some reason, Spotlight doesn't work on my System Preferences. No matter what I type in, everything dims. Anyone has a solution to this?
Thanks in advance!

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: skunk on Sat, Apr 30 2005 at 10:51AM PDT
Thanks for the info on forcing Spotlight to re-index, but it STILL can't find lots of stuff on my hard drive, both folders and files.

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: claviclaws on Sat, Apr 30 2005 at 12:17PM PDT
Also useful is the -f flag: I keep all my music on my iPod; Apple (probably in an attempt satisfy the RIAA etc etc etc) hasn't allowed Spotlight to index your iPod's music (although all other files on the iPod are indexed), even when specifying the correct directory. Fortunately the 'force' flag bypasses this inconvenience:

$ sudo mdimport -f /Volumes/your_iPod/iPod_Control/

for indexed music goodness.

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: timstringer on Sun, May 1 2005 at 10:43AM PDT
I was having a similar problem where much of my content wasn't showing up through Spotlight. So, I entered the "sudo mdutil -E /" command as suggested. Spotlight immediately when through a reindex process that took approximately an hour to complete. But, once it was done, I discovered that none of my imported mail could be accessed (the messages appear to still be there, but they don't show up under the Mail application).

Any suggestions are most welcome. Thanks!

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: geohar on Mon, May 2 2005 at 5:01AM PDT
Try

mdimport ~/Library/Mail/*/*.mbox/Messages

Good luck

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive - just be patient!
Authored by: romulis on Sat, Apr 30 2005 at 3:48AM PDT
When I installed tiger yesterday the first thing I wanted to try was spotlight.
First it took about an hour to dig through all my files (80GB - full :-( ) and even then it didn't seem to find everything.

After playing around for a while I noticed that the results I was getting from spotlight got better and better. After about 2 hours it worked beautifully!

Even so, it looks like you need a plugin if you want to look for system files or things like korn shell scripts. (I'll be looking into that today)

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: ylon on Sat, Apr 30 2005 at 6:45AM PDT
Has anyone been able to figure out how to get Spotlight indexing to remain on after a reboot on Tiger Server? `sudo mdutil -i on /` will turn indexing on for the system, however it does not remain on after a reboot I've found. I simply want to make Server behave like User, anyone have some insight here?

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: geohar on Sat, Apr 30 2005 at 12:07PM PDT
spotlight wouldn't find any of my iTunes tracks nomatter what I did. The same for some word documents. However, they both got indexed when I openned them in the finder (not when I played the tunes in iTunes). So I opened iTunes and minimized it (important or you'll have to leave your mac alone a while) and turned off the sound (you may like it but it's a pretty odd effect). Then ran the command below

find ~/Music -name '*.mp3' -or -name '*m4p' -exec open {} \;

This opens in turns each and every track. Voilla, indexed.

May be worth a try if the mdimport command gives no mileage.

[ Reply to This | # ]
Answer: mdimport path
Authored by: lullabud on Fri, Mar 21 2008 at 4:13PM PDT
I've had this problem and it REALLY bugged me because I wrote a spotlight driven music search for my website. TONS of results weren't showing up. The answer turned out to be simple though, and it was `mdimport ~/Music/iTunes/iTunes\ Music`. This does the same thing as your "open" trick, but without having to open every file.

Check `man mdimport` for more syntax stuff.

[ Reply to This | # ]
iPod index?
Authored by: jonasyorg on Sat, Apr 30 2005 at 3:00PM PDT
Has anyone found a way to force spotlight to show my music files on my ipod(shuffle in this case)? When I first plug it in it shows them fine for a couple of seconds, but then after it's done indexing it's pretty clear that apple explicitly is removing them! I've been waiting for a long time for spotlight as a way to get my files back off my ipod(20gb) so I can get them onto the shuffle easily, but it looks like apple is still block this.

anyone successfully able to show your files on your shuffle through tricking spotlight somehow?

[ Reply to This | # ]
iPod index?
Authored by: claviclaws on Sat, Apr 30 2005 at 4:43PM PDT
See my post above:

sudo mdimport -f /Volumes/your_iPod/iPod_Control/

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: fuzzy_logic on Sat, Apr 30 2005 at 3:34PM PDT
I still can't get Spotlight to work with my System Preferences. Like I said earlier, no matter what I type in, everything just dims. Any help would be greatly appreciated!

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: geohar on Sun, May 1 2005 at 11:13AM PDT
I get lots of warnings: for example

mdimport ~

gives

005-05-01 16:08:22.879 mdimport[721] Importer using too much memory (105 MB), hit threshold. Last file imported was: <file>

and

Incorrect start/end range ordering; fixing.

quite a bit.

Wonder if that's why the initital indexing didn't quite get everything?

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: lullabud on Fri, Mar 21 2008 at 4:19PM PDT
You could always call the mdimport command iteratively, like `find ~ -type f -exec mdimport "{}" \;

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: mankoff on Sat, May 7 2005 at 12:44AM PDT
I'm getting the same bug mentioned by others: no highlighting of of sysprefs from the sys pref search box, even after re-indexing with mdutil -E /

---
http://spacebit.dyndns.org

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: johnsawyercjs on Wed, May 25 2005 at 10:27PM PDT
For people uncomfortable with using command line, etc., another way to delete a volume's Spotlight index is to open the Spotlight prefpane, and drag the volume to Spotlight's "Privacy" window. The index will be deleted immediately. To get Spotlight to re-index the volume, remove it from the Privacy list.

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: elmimmo on Thu, Jun 9 2005 at 6:50PM PDT
If you do that with a folder, Spotlight apparently will not reindex the folder's contents. I tried with ~/Library/Mail/ and after removing it from the privacy list I could not get a single result in Mail when searching in "Entire Message"

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: mark hunte on Mon, Jun 13 2005 at 6:50PM PDT
Latest from Apple

Spotlight: How to re-index files and folders
Want to re-index a file or folder—or even an entire volume—for Spotlight (part of Mac OS X 10.4 Tiger)? Just do this:

From the Apple menu, choose System Preferences.
Click Spotlight.
Click the Privacy tab.
Drag a file, a folder, or even an entire volume (your hard drive) to the list.
Remove the item or volume you just added.
Spotlight will re-index the contents of the item you initially dragged to the list

---
mh

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: axman6 on Tue, Jul 26 2005 at 3:00AM PDT
Hello everyone, It seems to me that i have arather unique problem with spotlight. like for other people, it doesn't work. so i had a look around on the net and first found the help doc from apple on how to get spotlight to reindex a drive, just drop it in the privacy tab and then remove it. but it didn't show up (and i do know it can take some time for it to appear there so i waited quite some time) but sadly it never showed up. so i looked some more and found out about the command line tools like
mdutil
and
mdimport
. i thought to my self i'd done it, i'd found that answer. so i tried things like
mdutil -E /
which said "
mdutil -E /                         
/:
        Error, no index found for volume.
and
mdimport -f -d 2 /
. looked cool, lots of stuff being put on the screen, but all it was saying was "
mdimport[3591] _MDItemCreateFileSystemObject() failed for XXX
for every single file. now i really don't know what to do. when we first installed tiger it worked fine(ish) for a while and then it stoped working. please give me some suggestions for this, because this is one of the most useful features of tiger and i'd really love it if it worked. if you have a brillient ides, please e-mail me at axman6@gmail.com. Thanks heaps, Al.

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: axman6 on Tue, Jul 26 2005 at 3:00AM PDT
Hello everyone, It seems to me that i have arather unique problem with spotlight. like for other people, it doesn't work. so i had a look around on the net and first found the help doc from apple on how to get spotlight to reindex a drive, just drop it in the privacy tab and then remove it. but it didn't show up (and i do know it can take some time for it to appear there so i waited quite some time) but sadly it never showed up. so i looked some more and found out about the command line tools like
mdutil
and
mdimport
. i thought to my self i'd done it, i'd found that answer. so i tried things like
mdutil -E /
which said "
mdutil -E /                         
/:
        Error, no index found for volume.
and
mdimport -f -d 2 /
. looked cool, lots of stuff being put on the screen, but all it was saying was "
mdimport[3591] _MDItemCreateFileSystemObject() failed for XXX
for every single file. now i really don't know what to do. when we first installed tiger it worked fine(ish) for a while and then it stoped working. please give me some suggestions for this, because this is one of the most useful features of tiger and i'd really love it if it worked. if you have a brilliant ides, please e-mail me at axman6@gmail.com. Thanks heaps, Al.

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: UberFu on Sat, Jan 20 2007 at 8:38PM PST
THIS WORKS GREAT_ I DRAGGED MY HD OVER TO THE SPOTLIGHT PRIVACY SCREEN - CLOSED OUT OF SPOTLIGHT BACK TO THE MAIN SYS PREFS SCREEN - THEN CLOSED SYS PREFS DOWN_

RELAUNCHED SYS PREFS AND WENT BACK INTO SPOTLIGHT_

DELETED OUT THE HD ICON FROM THE PRIVACY SCREEN AND CLOSED OUT THE SYS PREFS_

FOR A MINUTE I DIND'T THINK THIS DID ANYTHING UNTIL I REALIZED MY SYSTEM SLOWED WAY DOWN_ CHANGING APPS - LOADING WEBPAGES SWITTCHING WINDOWS WITHIN THE SAME APP_

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: jgeraghty on Sun, Jul 24 2005 at 11:35PM PDT
I know this thread goes back to april but...
Is it possible to index networked drives. Does the drive need to be mounted (like a mounted NFS share) for spotlight to index it? How depandent on the UFS is spotlight?

[ Reply to This | # ]
10.4: Force Spotlight to reindex a drive
Authored by: christefano on Sun, Aug 12 2007 at 5:46PM PDT
This will be possible in Leopard, or maybe Leopard Server.

[ Reply to This | # ]