Get list of open files on external volume in macOS
By Dmitry Kabanov
Sometimes, when you try to eject an external volume (logical part of a disk), macOS fails to do this as some files are still open. Frequently, it is clear what files are open by which program and can be closed. However, not always so.
It has just happened to me — a file was open by stuck QuickLook app.
To find the list of open files on that volume:
lsof /Volumes/MyVolume