For a while I’ve been trying to find out what is using my external USB hard disk on my mac when I want to eject it. Its been driving me batty and I usually resort to a few choice expletives before pulling out the cable anyway.

Recently I read about the lsof terminal command - for example:

lsof /Volumes/BACKUPHD

This shows you what processes are currently busy stuffing around the specific volume. After running this command I found that Spotlight was the culprit. It just kept on indexing the drive, and on a nearly-full 1TB drive this takes a bit of time. D’oh

So to turn off indexing by Spotlight I had to go to System Preferences > Spotlight > Privacy Tab and add an entry for the volume that I wanted spotlight to ignore.

Easy, once you know how to do it ;-)