When trying to eject a disk in OS X I sometimes get this error message “DriveName is is use and could not be ejected”. Sometimes I can’t figure out what is using it. Turns out it’s pretty simple. Just do this command in terminal: lsof | grep DriveName Replace DriveName with the drive you are trying to eject. The lsof command simply lists all the open files, and the process that has the files open. This should make things easier to track down.
More: continued here