Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Enable Spotlight for disk images System 10.4
Tiger only hintBy default in 10.4, Spotlight won't index the content of mounted disk images. If you're like me and keep your mail (and other sensitive documents) on an encrypted disk image, none of that content is searchable from Spotlight -- whether from the Finder or even in an application like Mail.app -- because all searching is done through Spotlight indexes.

To enable indexing on a read/write disk image, you can use 'mdutil' (meta data utility) from the Terminal. Here's the command:
sudo mdutil -i on /Volumes/name_of_image
After a few moments (depending on how much data is in the image), you'll find your mail in Spotlight results. You can also do a man mdutil to see the rest of its commands.
    •    
  • Currently 2.00 / 5
  You rated: 2 / 5 (6 votes cast)
 
[25,014 views]  

10.4: Enable Spotlight for disk images | 20 comments | Create New Account
Click here to return to the '10.4: Enable Spotlight for disk images' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Enable Spotlight for disk images
Authored by: Jens Cramer on May 02, '05 01:08:10PM

Hi all!

I've a lot of disk images, each containing a closed project. Any idea how to index these unmounted disk images so that you can files inside them?

TIA,
Jens



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: pediddle on May 02, '05 11:20:44PM

Mount them?

If they're unmounted, they're completely opaque.



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: pascalpp on May 02, '05 02:27:30PM

Along similar lines, I'm hoping that Spotlight will grow to support offline volumes. Lot of folks (myself included) have a ton of data offline, archived to CDs and DVDs. Spotlight could really shine here if it allowed us to index and search these volumes and then prompt for the proper disc to be inserted when selecting an offline file in a Spotlight results window.

In the Classic Mac OS, Iomega used to ship a utility called Findit that did a really great job of indexing the contents of offline volumes (or the filenames, at any rate).

A similar utility available for OS X is 'locate', a command-line tool. Locator is a pretty capable GUI for locate, but I think it needs a fair amount of polish. At any rate, I'd really like to see this kind of functionality integrated into Spotlight.



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: meikokun on May 02, '05 05:07:23PM

CD finder is the app you want:
http://www.macupdate.com/info.php/id/960

does all you ask and more. The auto-catalogue function is just fantastic the first time you use it and have 200 discs/images/volumes/whatever to cat.

Hope this is of help
cheers



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: tokek on May 02, '05 11:42:05PM
I was just thinking about the same thing, since I also store files on an offline volume. I do
ls -R /Volume/ext_volume > local_file; hdiutil unmount /Volumes/ext_volume
to save a copy of the the filenames and unmount. To search through my dvds, I do
grep (search-term) dvd-*.txt
However it would be nice if there was a gui for something like this, esp. Spotlight, and maybe an Automator Action instead of ls. Maybe when I upgrade to Tiger. ;-)

[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: gregausina on May 02, '13 12:19:46AM

Hello,
I was using Autocat to catalog my external disks but it is no longer compatible with osx since Lion. It was smart because it was creating a king of ghost image of the disks filled only with aliases. Spotlight was able to scan theses images and the process was light and fast.
I've been thinking about creating some kind of ghost image of an external drive filled only with the spotlight index and some flags to prevent spotlight to rescan the image but to allow the offline index to be searched. My programming skills are too limited to even try to do that. Maybe someone around here? Or maybe it has been done already?
I really need something efficient to index my disks and don't want to rely on commercial solutions. I want something integrated within the system and avoid any compatibility issue in the long term.
Regards, Greg.



[ Reply to This | # ]
Indexing Samba
Authored by: jdarnel2 on May 02, '05 02:49:09PM

Hi everyone,

I'm in the process of forcing spotlight to index a samba share using mdimport and the volume name ("mdimport /volumes/192.168.123.20"). (I used some other switches, but you can read the man pages for those you'd like) I'm not sure if this is going to work, but it appears to be about half done. I'll post back with results.

Justin



[ Reply to This | # ]
Indexing Samba
Authored by: rvamerongen on May 02, '05 04:42:54PM

yes please post back your results. thanks



[ Reply to This | # ]
Indexing Samba
Authored by: ldm on May 02, '05 05:32:52PM

I submitted a hint where I managed to get an AFP volume indexed with mdutil -i on . That would not work with samba though. It is partially working for the following reason: It does not index the _content_ of PDF files. It seems to look at file names and meta-data but does not look inside files the way spotlight does for every other volumes....


---
--
Laurent



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: klktrk on May 02, '05 04:57:38PM

I'm probably being daft, but it seems to me that if you're using encrypted images to protect your data, the last thing you want to do is index your data to an unencrypted Spotlight database. Right?



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: maartensneep on May 02, '05 05:21:03PM

As far as I know the index of SpotLight is stored on the same volume, so the index is encrypted as well.

Maarten



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: SandManMattSH on Jul 30, '05 05:05:46PM

Not true!!
It <i>does</i> do this for removable hard drives, but not for disk images (by default).

The workaround for this is to run:
sudo mdutil -p [volume]


~Matt



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: stcanard on May 02, '05 05:24:22PM

It seems that spotlight stores the data on the root of the indexed volume, so odds are the index would only be availble when you mounted the volume. I believe spotlight also repects file permissions.

Of course, I would want to check that before I actually indexed it!



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: tterragcnoom on May 02, '05 05:15:57PM

So I'm trying to get spotlight to search through hidden folders like /usr and /var and /bin... I tried using this command to enable it but spotlight still doesn't seem to look in these directories... anyone have any ideas? Thanks,

-Garrett



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: wbiggart on May 03, '05 04:04:20AM
you can force mdimport to index any path that you want. mdimport is the process that actually indexes the files, whereas mdutil sets indexing on/off for volumes. i think.
 $>mdimport -f /path/to/path 
the -f switch tells mdimport to ignore the path restrictions that it knows about. i forget where i read this, but someone else figured it out.

walter

[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: t0fukrunch on May 04, '05 12:26:28PM

I think this command only forces a one time indexing of the specified directory. To test this you can execute the mdfind -live testme command and then try creating a directory called "testme" in one of the directories in question. If a directory is being monitored by Spotlight then mdfind should detect changes in it almost immediately, and consequently "findme" will be found almost immediately.

A message on Apple's Spotlight discussion forum mentions a way to get around this by using the 'INCLUDE' section of the /.Spotlight-V100/_rules.plist file, but the technique described there hasn't worked for me since, among other issues, Spotlight seems to overwrite the _rules.plist file when a mdutil -E / command is issued to reindex the root volume. I tried modifying _rules.plist immediately after issueing the reindex command, but this didn't work for me either.



[ Reply to This | # ]
10.4: Enable Spotlight for disk images
Authored by: t0fukrunch on May 04, '05 02:39:33PM
Doh -- it turns out I had an error in my _rules.plist file so that mdutil -E / replaced it with a fresh copy. The aformentioned technique works for me as promised!

[ Reply to This | # ]
But it's enabled by default...
Authored by: thornrag on May 02, '05 11:37:18PM

In the bottom right-hand corner of the Advanced search window is a list of targets to search, including all available mounted hard disks, removable media, and disk images. Click Computer to search everything, including any secure disk images, or just click the name of the disk image to look for results just within that volume.

One of the first things I tested was to mount my secure disk image and run a search with Spotlight. All of the documents in my secure disk image were immediately available. I was actually hoping this hint would reveal a way to prevent a disk image from being searched at all, in a way that would stick with the disk image -- and not with each computer I might open it on.

I don't know why you'd have to go through these steps to search a disk image. It's all there already.



[ Reply to This | # ]
But it's enabled by default...
Authored by: the1truestripes on May 03, '05 12:52:55AM

According to the Ars Technica article the spotlight index is stored in /Volume/whatever/.Spotlight-V100 which appears to be a directory on my system.

I guess the first thing to try is turn spotlight off for the volume and then run "touch /Volume/secret/.Spotlight-V100; chmod ugo-rwx /Volume/secret/.Spotlight-V100" and see if that keeps it from indexing. If that doesn't work try it again, but follow the chmod with "chflags schg /Volume/secret/.Spotlight-V100". If that doesn't work, maybe play around with ACLs.

Of corse you could manage to really upset Spotlight (i.e. find a setting where spotlight doesn't index your secret volume because it has decided to stop indexing everything), so be warned :-)



[ Reply to This | # ]
Enable Spotlight for disk images - Leopard
Authored by: Lou Kash on Mar 03, '09 04:03:17PM

Thank you!
It also works on Leopard for enabling content search on sparse disk images.



[ Reply to This | # ]