Stop Spotlight From Indexing External Drives

Spotlight in OS X annoyingly indexes external devices like USB pen drives and cameras when mounted. You can block spotlight by using the ‘privacy’ setting in preferences, however once unmonted this seems to get forgotten. To make sure spotlight never indexes a drive you can add a hidden file to the root folder of that device to prevent it getting indexed forever. Create a file called .metadata_never_index For example to block my camera all I did was :
touch /Volumes/CAMERA/.metadata_never_index
Now if only there was a setting to block all external drives…