How to Eject All Disks on Mac at Once
Unplugging your MacBook from a dock full of drives? Eject every external disk and disk image in one step with Raycast, or with Finder, Terminal and a one-line AppleScript.
Unplugging your MacBook from a dock full of drives? Eject every external disk and disk image in one step with Raycast, or with Finder, Terminal and a one-line AppleScript.
You're heading to a meeting and your MacBook is plugged into a dock with a backup drive, an SD card and a couple of mounted disk images. Ejecting them one by one takes longer than packing your bag.
The short answer: open Raycast, type Eject All Disks and press Return. Every mounted disk is ejected in one go, and you can unplug. It's one of Raycast's built-in System Commands, and it's free. Without Raycast, select the disks on your desktop and press ⌘ E.
| Method | All disks at once | Keyboard only | Setup |
|---|---|---|---|
| Raycast Eject All Disks | Yes | Yes | None |
| Finder | If you select them all | ⌘ E | None |
| AppleScript in Terminal | Yes | Yes | A one-liner |
↵.
If a disk won't eject, an app is still using one of its files. Quit it and run the command again. Quit All Apps is another built-in command if you want a clean slate.
Finder ejects one disk at a time, or several if you select them together:
⌘ E, or drag it to the Trash, which turns into an Eject icon.⌘ and click each one, or drag a box around them) and press ⌘ E.External disks only show on the desktop if Finder → Settings → General → External disks is turned on.
This one line asks Finder to eject every disk that can be ejected:
osascript -e 'tell application "Finder" to eject (every disk whose ejectable is true)'
To eject a single disk, use diskutil:
diskutil eject /Volumes/Backup
Save the first line as a Script Command and it becomes a Raycast command too, but the built-in Eject All Disks already does the same job.
Here's a quick tour of what else it can do, in under seven minutes:
Not by default. Raycast's free Eject All Disks command does it in one step, and you can give it a hotkey. In Finder, you can select several disks on the desktop and press ⌘ E.
Select the disk in Finder or on the desktop and press ⌘ E. On older Apple keyboards with an Eject key, that key ejects optical discs.
An app is still using a file on it. Quit apps that might have its files open, including Terminal windows whose current folder is on the disk, then try again. macOS usually names the app that's blocking it.
It can be. If something was still being written, the file or the drive's file system can be damaged. macOS warns you with a "Disk Not Ejected Properly" notification.
Run the one-line AppleScript from the Terminal section above, which asks Finder to eject every disk that can be ejected. To eject a single disk, use diskutil eject followed by its path, like /Volumes/Backup.
More guides
When an app freezes, press ⌥ ⌘ Esc to force quit it. Here's every way to quit and force quit apps on a Mac, from the keyboard, the Dock, Activity Monitor, Terminal and Raycast.
Port 3000 already in use? Find out which process is listening on a port and stop it, with lsof and kill in Terminal, Activity Monitor, or the free Port Manager extension.
Find out what's slowing your Mac down. Check CPU and memory usage with Activity Monitor, a few Terminal commands, or the free System Monitor extension for Raycast.
Dragging an app to the Trash removes the app, but not the files it left behind. Here's how to uninstall apps on your Mac completely: with Finder, System Settings, Raycast, or Terminal.
