Select Finder, then click the Apple Logo at the top left of your Mac screen and click Force Quit Finder.
Click the Apple Logo at the top left of your Mac screen and click Force Quit…, select Finder and click Relaunch.
Open the Terminal application (Applications > Utilities > Terminal) to check which files are using the external drive.
Figure out the full hard drive path with df.
In my case, it’s /Volumes/MyBook.
df -h Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk0s2 931Gi 560Gi 371Gi 61% 146744600 97236142 60% / devfs 333Ki 333Ki 0Bi 100% 1152 0 100% /dev map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home /dev/disk2s2 16Ti 14Ti 2.4Ti 85% 911128025 162592802 85% /Volumes/MyBook
Do an lsof against the affected hard.
lsof /Volumes/MyBook COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Finder 258 tommye 29r DIR 14,6 68 261851 /Volumes/MyBook/.Trashes/37721 Finder 258 tommye 30r DIR 14,6 2244 83672 /Volumes/MyBook/Pictures/Wallpapers Finder 258 tommye 38r DIR 14,6 3060 165630 /Volumes/MyBook/Videos/Other Finder 258 tommye 39r DIR 14,6 5100 70920 /Volumes/MyBook/Pictures/2011/2011-1014 Finder 258 tommye 40r DIR 14,6 952 165501 /Volumes/MyBook/Videos/Movies Finder 258 tommye 63r DIR 14,6 136 166000 /Volumes/MyBook/Videos/Tommy Elmesewdy Finder 258 tommye 76r DIR 14,6 340 178928 /Volumes/MyBook/World/Desktop Finder 258 tommye 79r DIR 14,6 16796 81587 /Volumes/MyBook/Pictures/Random
I noticed a bunch of files that I had previously copied over to my local drive still being accessed, in my case, by the Finder application for some reason (the copy had already finished).
All I had to do was kill PID 258, which was Finder.
If that doesn’t kill the process, kill it with a -9 option.
kill -9 258
Finder will relaunch after you kill it and then you should be able to eject your external drive properly.