Here’s one that I bet has happened to most of us. You insert a USB thumb drive in your Mac to copy some files off. You copy those files off to the Mac and then immediately try to eject your USB drive. Your Mac tries to reject the drive but finally comes back and tells you that the drive and use or some files on the drive are in use.
The situation has driven me crazy for years. But the reasoning behind what’s happening perfect sense. One of the great features of a Mac is that all your data is indexed to give you the ability to find things quickly. The software on the Mac that does this index is called Spotlight. Spotlight, being very efficient, immediately begins to index any new drive it finds plugged into your computer. USB drives, particularly solid-state drives like thumb drives are often very slow. It takes a while to read and write files to these drives. What often happens is that Spotlight has begun indexing that drive and when you try to eject it the Mac sees files on the drive in use and refuses to eject the USB drive.
The solution to this is actually fairly simple particularly on a machine that you often plug the same drive into. All you need to do is go to system preferences and select spotlight. At the top of the Spotlight dialog is a privacy tab. Click on the privacy tab. Now you can press the plus icon near the bottom of the dialog and add your USB drive to the list of drives you don’t want spotlight to index. Even easier, you can simply drag the drive over-the-top of the Spotlight privacy tab and drop it. This adds your drive to the do not index list.
Now when you insert the USB drive, you can just drive copy files and then eject it. Spotlight will not have started trying to index it and the drive will eject quickly and easily.