Index mounted .dmg?

This follows up on a conversation in another thread; I thought it best to start a fresh one.

I've got some sensitive documents on a laptop that I maintain in an encrypted .dmg file. It's easy enough to get at them - just mount the .dmg. The problem is that I can't figure out a way to persuade Spotlight to index them from the .dmg. Name searches work okay but content searches return nothing. The same documents, residing in a regular folder, are indexed and fully searchable - so it's not a plug-in issue. I tried force-indexing the mounted .dmgs using both SpotlightIndexer and Highlight, and, while both apps report success, the .dmg file contents remain unsearchable.

Any suggestions?

Dual 2.5Ghz G5, Mac OS X (10.3.9), 3.5MB RAM

Posted on Jan 25, 2007 2:23 PM

Reply
13 replies

Jan 25, 2007 6:40 PM in response to Daniel Marr

I agree. It would be stupid to index an encrypted .dmg file. I guess I wasn't clear enough. These are active files and from time to time I mount the .dmg to work with them. At that point they are no longer encrypted. I would like for Spotlight to index the mounted, unencrypted, disk image volume so that I can use Spotlight's various search capabilities on those files, while the disk image is mounted an unencrypted.

Is that possible?

Jan 26, 2007 4:17 AM in response to Daniel Marr

This may be impossible but it isn't because a mounted .dmg is like a CD that cannot be indexed. It's more like an external hard drive, which SL automatically indexes upon mounting. I can write to the mounted .dmg just like an external drive. I can add, change or save documents stored on it, and all those changes to the volume are saved to the encrypted .dmg image when I eject the mounted volume. I have complete R/W access to the mounted .dmg, just like a hard drive, not like a CD. (There is incidentally plenty of room in the .dmg for an index - this is a 100MB image holding only 40MB of files).

Do we know this is impossible?

Jan 26, 2007 5:58 AM in response to Daniel Marr

I guess I'm not being clear. I don't want to index the .dmg as such. I want to index, even if only temporarily, the mounted volume into which the .dmg expands when I open it. The mounted volume is, to all appearances, the same as a mounted external hard drive, with folders and files and documents and the like.

It is beginning to sound like this is not possible, even though I can't think of any reason it shouldn't be.

Jan 26, 2007 7:50 AM in response to Daniel Marr

Not only "doesn't", but now I am coming to understand, "won't". That doesn't make much sense to me, but it is what it is I guess. Perhaps in Leopard, when Apple enables SL to index networked volumes, they will include the ability to index mounted .dmg images.

Meantime, I've determined that Easyfind has no trouble searching the contents of the mounted volume, at least inside files of human-readable formats like .rtf and .txt. This is at best half a solution in that most of my files are .doc files, but it's better than nothing.

Jan 26, 2007 8:23 AM in response to John Dorsey

I don't use "Spotlight" very much - it has it's strengths, but the fact that it misses items is something that is not tolerable for what I would need it for. Anyway, that's just a disclaimer to say that I haven't tested this thoroughly, but have you tried using 'mdutil'? I.e. while logged in to an "admin" account, entering something like this using "/Applications" > "Utilities" > "Terminal.app":<pre>sudo mdutil -i on /Volumes/volumename</pre>I tried creating two disk images, and ran the command only on one. A test MSWord file was copied to each, but searching for a keyword in the content, only the copy on the enabled volume was found when searching from either the Spotlight menu or using a "Find" search for "Contents" (adding both volumes as targets in "Others…)".

Jan 26, 2007 9:06 AM in response to biovizier

Sonofagun! That did the trick! What's more, the command is sticky (at least within the same boot of OS X) - I ejected the volume, the index vanished with it, but when I remounted it Spotlight duly proceeded to re-index it.

On the assumption that this command doesn't persist across reboots, what I need now is to remember how to turn a terminal command into a double-clickable file!

Thanks!

Jan 26, 2007 11:56 AM in response to Mike-N-nahyunil

If that's indicated by the invisible folder (file?) .Spotlight-V100, then it appears to reside on the mounted volume. (Found it with EasyFind, hah.) I can also report that indexing upon re-mount is very quick, so I'm assuming that it's not rebuilding the thing from scratch.

This is handy. It means I can enjoy the benefits of both encrypted folders and Spotlight content searching, and it's painless once you take care of the initial setup.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Index mounted .dmg?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.