2007/02/28

Spotlight, LaunchServices and backup volumes

When I select a file in the Finder and right click to "Open With ->", the system pauses, my backup hard drive spins up, and I get a menu showing 5 or 6 duplicate entries for, say, VLC.app.

My backup volume is often online, so it's visible to LaunchServices and Spotlight, et al. Maybe this is the root cause of my problem. But I need to leave the backup volume online because it shares a hard drive with other volumes that I need.

What to do? Is this a problem with Spotlight? With LaunchServices? Regardless of Finder misbehavior, I don't want Spotlight indexing my backup drive; it's just a mirror of my boot volume. Time for some googling.

Spotlight Indexing



From ~stevenf: Disabling Spotlight for a Volume: To see if indexing is on for a volume:
$ sudo mdutil -s /Volumes/Backup


To get rid of the index for a volume and ensure that it is not re-indexed in future:
$ sudo mdutil -i off -E /Volumes/Backup


I've just performed these steps and will see if it works following my next backup.

I'm using SuperDuper to do periodic, full backups. Their forum says that SD will honor Spotlight indexing preferences for a target volume:
As of v2.0, when used with Tiger 10.4.3 or later... just add the volume to the Privacy tab of the Spotlight preference pane. We'll automatically ensure that that state is maintained, and all should work fine.


Of course I can't figure out how to add the volume to the Spotlight preference pane. I've tried dragging it in, but it doesn't show up in the list. Hence the above shell commands.

LaunchServices Caching



Since LaunchServices is already caching redundant references to my backed-up apps, with apparent disregard for duplicate (Unix) pathnames. So I also need to clear its cache. I've used these steps:

$ cd /Library/Caches
$ sudo rm com.apple.LaunchServices-*.plist


I've also restarted my system, since I didn't know whether it would suffice to log out and back in, or to simply kill launchd from within Activity Monitor.

Just now everything is looking good.

No comments: