Free fix

How to eject all disks at once on Mac

Three drives on a dock, and Finder wants them ejected one at a time before you pick up the laptop. Eject them together instead.

Short answer

Finder ejects one disk at a time from the sidebar, or every disk you select on the desktop with ⌘E — but there’s no single button for all of them. MacFixes adds a one-click eject to its Quick toggles in the menu bar panel.

Free in MacFixes.

What macOS gives you

In Finder, click the eject button next to a disk in the sidebar, or select a disk and press ⌘E (File → Eject), or drag its icon to the Trash, which turns into an Eject button. If your disks show on the desktop, you can select several and press ⌘E to eject them together. There’s no menu-bar button that ejects every disk at once.

How MacFixes fixes it

  1. 1
    Turn on the fix
    Open MacFixes Settings → Everyday and turn on “Quick toggles” (or type its name into Search for a fix).
  2. 2
    Allow Automation if asked
    Some toggles ask for Automation permission the first time you use them.
  3. 3
    Click Eject
    Eject your disks from the Quick toggles card in the menu bar panel, then unplug.
DownloadmacOS 14 Sonoma or later · free

Why a Mac wants disks ejected first

When you save a file to an external drive, macOS doesn’t always write it out at that moment. It can hold changes for a little while and write them in batches, which is faster. Ejecting tells macOS to finish every write and let go of the disk, so pulling the cable afterwards can’t cut a file off half-written.

Unplug a drive without ejecting it and macOS shows a “Disk Not Ejected Properly” notification, asking you to eject the disk before disconnecting it or turning it off. Usually nothing is lost: the warning appears whether or not anything was being written at that moment. But when something was, that file can be damaged, and on a drive you unplug this way every day, sooner or later something is.

Every way to eject disks in macOS

From the Finder sidebar. Every disk under Locations has an eject button next to its name. Click it. This is the way most people use, one disk at a time.

With a keyboard shortcut. Select a disk in Finder and press ⌘E, or choose File → Eject. Control-clicking a disk also offers Eject.

From the desktop, several at once. If your disks appear on the desktop, select the ones you want (⌘-click each, or drag a box round them) and press ⌘E. They eject together. To make disks show on the desktop, open Finder → Settings → General and tick External disks under “Show these items on the desktop”. The same list for the sidebar is under the Sidebar tab.

From the Computer window, several at once. In Finder, choose Go → Computer (⇧⌘C). Every disk is listed there whether or not it shows on the desktop. ⌘-click the external disks you want and press ⌘E.

By dragging to the Trash. Drag a disk’s icon toward the Dock and the Trash turns into an Eject button. Nothing is deleted.

From Disk Utility. Select the disk in the sidebar and click Eject in the toolbar. This also reaches disks that Finder doesn’t show.

From Terminal. diskutil eject followed by the disk’s path, such as /Volumes/Backup, ejects one disk. To eject every ejectable disk at once, osascript -e 'tell application "Finder" to eject (every disk whose ejectable is true)' asks Finder to do it — the closest thing to an Eject All that macOS has built in, if you’re happy keeping a command around.

When a disk won’t eject

If macOS says the disk wasn’t ejected because one or more programs may be using it, something still has a file on that disk open. Recent versions of macOS sometimes name the app; often they don’t.

Look for the obvious first. A document from the drive open in an app, an app running from the drive, a Finder window or Quick Look preview showing it, or a Terminal window whose current folder is on it. Close or quit them and eject again.

Time Machine and Spotlight. A backup in progress holds its backup disk; skip or finish the backup from the Time Machine menu, then eject. Spotlight can be indexing a drive you just plugged in, which holds it for a while.

Find it with Terminal. lsof followed by the disk’s path, such as /Volumes/Backup, lists files on that disk that are open and which app has them.

Force Eject is the last resort. After a failed eject, macOS may offer Force Eject. It works, but whichever app had a file open loses it mid-way, which is exactly what ejecting was meant to prevent. Save and quit first if you can.

Disks that disconnect on their own

Sometimes the “Disk Not Ejected Properly” warning appears when nobody touched a cable. Common causes are a loose connector, a hub or dock that doesn’t give the drive enough power, or a drive or dock that drops its connection while the Mac sleeps. Try the drive on a different port or cable, plug it straight into the Mac rather than through a hub, and give a power-hungry drive its own power supply if it has one.

Disk images count as disks too. Every .dmg you open sits in the sidebar until you eject it; if they pile up after installing apps, install from a .dmg in one click and the disk image is ejected for you.

Ejecting from the menu bar with MacFixes

MacFixes’ Quick toggles put a few things macOS buries in one place in the menu bar panel: eject your disks, empty the Trash, switch dark mode and hide the desktop icons, each in one click. Before you unplug a dock or pick up the laptop, open the panel and click eject, without opening Finder or finding each disk in the sidebar.

If an app still has a file open on a disk, free it as described above, then click eject. Some toggles ask for Automation permission the first time; the section below says what that permission allows.

The same toggles help with the other thing worth doing before you plug into a projector or share your screen: hide your desktop icons in one click, and bring them back after.

Permissions, and turning it off

“Quick toggles” needs macOS’s Automation permission. macOS asks you, and you allow it once.

  • Automation lets an app send commands to one other app, such as asking Finder which folder is open. macOS asks separately for each app it talks to. You can see it, and take it back, in System Settings → Privacy & Security → Automation.

To stop using it, open MacFixes Settings → Everyday and use the switch on the “Quick toggles” row.

Questions

How do I eject all disks at once on a Mac?

In Finder, choose Go → Computer (⇧⌘C), ⌘-click the external disks and press ⌘E — or select them on the desktop and press ⌘E. From the sidebar, Finder ejects one disk at a time. MacFixes adds a one-click eject to the Quick toggles in its menu bar panel.

What is the shortcut to eject a disk on a Mac?

Select the disk in Finder and press ⌘E, or choose File → Eject.

Why does my Mac say “Disk Not Ejected Properly”?

The disk was disconnected before it was ejected — unplugged, turned off, or dropped by a loose cable, an underpowered hub, or a dock that lets go while the Mac sleeps. Eject before unplugging, and try another port or cable if it happens on its own.

What do I do when a disk won’t eject?

Close any files from the disk and quit apps running from it, and let a Time Machine backup finish. Terminal’s lsof command, followed by the disk’s path, shows which app still has a file open. Use Force Eject only as a last resort.

Is it bad to unplug a drive without ejecting it?

Often nothing happens, but if macOS was still writing to the drive, the file being written can be damaged. Ejecting first makes sure every write is finished.

More fixes macOS doesn’t give you

One of 47 fixes and 10 apps in MacFixes. Every fix · Every app · Something else your Mac won’t do? Request it.

Eject all disks at once with MacFixes

MacFixes has 47 fixes for things macOS gets wrong or leaves out. Add only the ones you want. This one is free. macOS 14 Sonoma or later.

Download