1. Close what uses the drive
Quit apps that have a document, a photo or music library, a project or a virtual machine open from the drive, and close Finder and Quick Look windows that show it. Then eject again.
2. Find out which program it is
Ejectify 1.4.10 and later names it for you: click “Force Eject…” in the message that the drive could not be ejected. Ejectify asks the drive once more and, if it is still in use, shows which program holds it before anything is forced. You can still cancel there. To find it yourself:
Open Terminal (Applications › Utilities) and run this line, with your drive's name in place of DRIVE. If something holds the drive, macOS names it, for example “dissented by PID 312 (mds)”. If nothing does, the drive is ejected.
diskutil eject "/Volumes/DRIVE"To list every program with a file open on the drive, run this line. It only reads; it asks for your Mac password because system processes are hidden otherwise.
sudo lsof "/Volumes/DRIVE"Prefer a window to Terminal? The free, open-source app Sloth shows the same list. Type /Volumes/ and your drive's name into its filter, and authenticate in Sloth to include system processes such as Spotlight. Use it only to look: don't end processes from it that you don't know.
3. The usual suspects
- mds, mds_stores, mdworker
- Spotlight is indexing the drive. Wait a few minutes, or add the drive to Spotlight's Search Privacy list in System Settings so it is not indexed at all.
- backupd
- Time Machine is backing up to or from the drive. Let the backup finish, or choose Skip This Backup in the Time Machine menu.
- fseventsd, QuickLookUIService
- macOS keeps track of changes and previews. These usually let go within seconds; eject again.
- Backup, sync and antivirus apps
- Carbon Copy Cloner, Backblaze, Dropbox, virus scanners and the like may keep scanning the drive. Pause them or exclude the drive in their settings.
Eject before sleep
With “Force repeated ejection before sleep” switched on, Ejectify asks a busy drive again for a few seconds. If the same program still holds it after about 10 seconds, Ejectify stops asking so your Mac is not kept awake. The drive then stays mounted through sleep, and Ejectify tells you when you are back.
Force Eject: use at your own risk
If the program won't let go, “Force Eject…” ejects the drive anyway. The program keeps running, but it loses the drive: anything it has not yet saved or finished writing can be lost or damaged, for example an open document, a copy in progress or a backup. The drive's file system normally stays intact. Quit the program first whenever you can, and never force an eject while files are being copied or a backup is running. Ejectify only forces an eject when you click “Force Eject” and confirm the warning: never on its own, never before sleep, never by timer and never from your iPhone or an assistant.
Still stuck?
Write to us on the support page and tell us which program the Terminal line named. Contact support