The volume cannot be ejected because it is currently in use

My only computer is a Macbook Air with a 128gb SSD so if I am home and docked I always have an external hard drive attached.

I make heavy use of symlinks to keep my SSD tidy, but I occasionally run into trouble when trying to eject my external.

The volume can’t be ejected because it’s currently in use.

That’s not very helpful is it?

Pop open Terminal and issue the following command (where myDrive is the Volume name you are trying to eject)

lsof | grep /Volumes/myDrive

Mine recently looked something like this

List of open files

In my case the offender was Mail’s Indexing process.

After, notice that 272? That is the process ID (PID for short).

In your terminal window take your PID and issue the kill command (where 272 is your PID)

kill -9 272

Go ahead and eject that volume.

Lets go back to the command

lsof | grep /Volumes/myDrive

lsof is simply “list of open files”

Go ahead and run that command by itself to see the madness.

grep is a text search utility so what you are saying here is basically give me a list of open files, but search that list for only lines that contain ‘/Volumes/myDrive’ and show me those.