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.

UPDATED

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.

MethodAll disks at onceKeyboard onlySetup
Raycast Eject All DisksYesYesNone
FinderIf you select them all⌘ ENone
AppleScript in TerminalYesYesA one-liner

Eject all disks with Raycast

  1. Open Raycast.
  2. Type Eject All Disks and press ↵.
  3. When the disks disappear from Finder's sidebar, unplug them.
Eject All Disks is a built-in Raycast command. One press ejects every mounted disk before you unplug.
Eject All Disks is a built-in Raycast command. One press ejects every mounted disk before you unplug.
Pro tip: give the command an alias like ej, or a hotkey, so leaving your desk is two keystrokes.

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.

Eject from Finder

Finder ejects one disk at a time, or several if you select them together:

  • In the Finder sidebar, click the Eject button next to the disk.
  • On the desktop, select a disk and press ⌘ E, or drag it to the Trash, which turns into an Eject icon.
  • To eject several, select them all on the desktop (hold ⌘ 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.

Use Terminal

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.

New to Raycast?

Here's a quick tour of what else it can do, in under seven minutes:

Frequently Asked Questions

Is there a shortcut to eject all disks on Mac?

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.

What's the keyboard shortcut to eject a disk on Mac?

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.

Why can't my Mac eject a disk?

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.

Is it bad to unplug a drive without ejecting 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.

How do I eject all disks from Terminal?

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.

Eject every disk with one command before you unplug. Try Raycast for free.

Download