When you get the drive-can’t-be-ejected notice, it is often worth closing all the apps that have no files open. There are a handful of applications that “hang on” to a drive, even after all the files on that drive/partition are closed. TextEdit is one of these bad boys.
But the worst offender of all is Spotlight. Once Spotlight starts indexing an external drive/partition it is very difficult to pry that drive/partition loose from its clutches. You can tell if spotlight is the culprit by trying to add the drive/partition to Spotlight’s Privacy panel. If a drive/partition is currently being indexed, Spotlight will refuse to let you add that drive/partition. Your only choices are to disable Spotlight (as Kornelis described) or be patient. I make that choice on the size of the drive and the complexity of the file structure.
—GetRealBro