AppBITS: Jettison Solves macOS Disk Ejection Annoyances

Originally published at: AppBITS: Jettison Solves macOS Disk Ejection Annoyances - TidBITS

One of the longest-standing aspects of the Mac user experience is the necessity of ejecting disks before turning them off or unplugging them. Initially, this meant literally ejecting floppy disks from their drives, but Apple retained the term even after adding non-removable media.

All About Eject

The need for the Eject command arises from two reasons. First, if there are open files on a disk, macOS refuses to let you eject it because doing so might result in data loss. Second, the Eject command forces macOS to flush any data cached in memory and write it to the physical disk, ensuring that everything is saved and preventing file corruption.

Despite all the advances in macOS since 1984, we still need to virtually eject disks before physically disconnecting them. Today, you can select a disk and choose File > Eject (Command-E) or drag one or more disks to the Trash icon, which helpfully changes to an Eject icon so no one is led to think the disk or its contents will be deleted. If there are multiple volumes on a single physical disk, macOS allows you to eject just the selected one or, as is often desirable, all of them.

Eject All dialog

It’s also still possible to encounter a situation where a file remains open on a disk such that macOS won’t let you eject it. Sometimes the solution is simple—just quit the offending app. Other times, macOS doesn’t identify the app, leaving you unsure of what to quit or if quitting is even an option, especially when a low-level process has the file open. You can throw caution to the wind and power the drive down or unplug it unceremoniously, but macOS always chides you for such uncouth behavior.

Disk not ejected dialog

Disk not ejected properly notification

If macOS cannot eject the disk or identify the rogue programs, it allows you to force eject the disk—a software override that bypasses macOS’s safety checks but still flushes cached data, making it safer than simply unplugging. If that makes you too nervous, your only recourse is to shut down your Mac, disconnect the disk while everything is powered off, and then turn the Mac back on. You can also restart and unplug it between quitting all applications and macOS booting up again, though that requires more precise timing.

Force Eject dialog

I’ll admit, I occasionally forget to eject a disk before disconnecting it or inadvertently unplug the wrong disk while working behind my Mac. However, I’ve never experienced any file or disk corruption that I could attribute to that action. Still, it’s never a good idea to cut power to a drive or unplug it without first ejecting it.

Jettison That Disk!

For the most part, I don’t have trouble ejecting disks. Sometimes, when I try to eject the duplicate that SuperDuper makes of my internal boot disk every night, the backup disk’s icon disappears from my desktop, but I’m still chided for failing to eject “Disk Name – Data” when I disconnect it. I feel that it’s unfair because I had ejected the disk, but I can’t reproduce the problem reliably.

Regardless, many people experience recurring issues with external disks. When leaving the house with your laptop, you can close the lid and disconnect all its cables without worry… except for those connected to external disks, which remain mounted even when the laptop is asleep. Others find themselves in situations where macOS seems incapable of ejecting disks for no good reason. And still more people store working data or media on external drives that they want to mount and dismount in different situations.

Those who need more control over their external disks than macOS provides should consider Jettison, available for $6.95 from St. Clair Software, which provides a plethora of features designed to simplify working with external disks. It’s a menu bar utility that’s entirely up front about its capabilities, which you can try for free for 15 days. It runs on macOS 10.13 High Sierra and later, and is compatible with both Intel-based and Apple silicon Macs.

Jettison menu

Easily accessed commands in Jettison’s menu enable you to:

  • Eject all your external disks at once
  • Eject all your external disks and then put the Mac to sleep
  • Sleep your Mac
  • Eject individual volumes
  • Mount available volumes
  • Remount disks that you previously ejected

Jettison’s Settings window provides extensive control over when and how disks are ejected, reported to the user, and remounted.

Jettison General settings

These settings allow Jettison to:

    • Automatically eject disks before system sleep
    • Automatically eject disks after the display turns off
    • Automatically eject disks before logout, restart, and shutdown
    • Control what sort of disks will be ejected: hard disks and SSDs, DVDs and CDs, disk images, network disks, and SD cards
    • Show a progress window while ejecting and remounting, since both tasks can sometimes take longer than seems reasonable
    • Display notifications after ejecting and remounting
    • Let you use hotkeys for ejecting external disks, ejecting and then sleeping, and remounting
    • Automatically remount disks upon wake-up
    • Eject specific internal disks along with external disks
    • Avoid ejecting specific disks
    • Avoid remounting specific disks

A few of these may need more explanation. For instance, why would you want to eject your disks automatically after the display turns off? Since the display may go black before the Mac goes to sleep, some people found themselves disconnecting disks when they shouldn’t have because the screen was off while the Mac was still awake.

Also, what’s up with ejecting disks before logout, restart, and shutdown, given that macOS already ejects most disks in the latter two cases? One reason for that option is that you might have an encrypted disk containing private data that you don’t want to be accessible to other accounts on your Mac. Another reason arises if you have a removable media drive and want to eject whatever disc is in there before shutting down.

Jettison developer Jon Gotow tells me something that’s not immediately obvious. When Jettison is set to eject disks before sleep, it automatically quits Music and Photos in case the user is storing their libraries on an external disk. When the Mac wakes up again, Jettison relaunches those two apps. You can find similar tweaky details about how Jettison works (and what might prevent it from working as expected) in the Jettison FAQ.

Jettison can’t (or at least won’t) eject disks containing open files, but it tries to help you identify and quit the associated apps.

Jettison warning dialog

Everyone has different needs and circumstances, but if you’ve found yourself forgetting to eject disks before disconnecting them from your laptop or fussing to eject and remount disks regularly, Jettison may be your new favorite utility. Give it a try.

3 Likes

Software on my Mac mini is fully up to date. It has an external drive directly attached and a network drive connected over wifi, each of which is a Time Machine. Once or twice a week, when I start using the system in the morning, I see a notification that a disk was disconnected without being ejected. However, the icons for both external drives are visible on the desktop and accessible in Finder. This has persisted since Ventura. I suspect the issue is related to the networked Time Machine and it is only a minor annoyance.

If a directly-connected storage device (e.g. USB) is disconnecting, then there may be a problem with the device. HDDs and SSDs can get flaky as they get old and start wearing out. They’ll go off-line, causing macOS to report the disconnection, and then they’ll come back on-line a bit later, so you see the icon on your desktop.

Make a backup or two, run some diagnostics and consider replacing the device.

Overheating can also cause this. If your storage device doesn’t have an enclosure capable of dissipating its heat (or if you are keeping it in a place without sufficient airflow), this can happen. Especially for high performance devices, they tend to run hot. I’ve found this with HDDs that are connected 24x7 - they need to be in an enclosure with a fan or they will overheat after a day or two.

1 Like

David,
Thank you. Helpful suggestions. I’ll run the diagnostics.

Also try gently wiggling both plug ends of cable(s) connecting the external drive. And move the rest of the cable around a bit. If this caused the drive to disconnect then you have a flaky cable. Over time plugs can stop fitting snugly, and wires can become susceptible to shorts or disconnections, especially wherever the cable is routinely stressed (near the plugs for instance.)

3 Likes

A quick note for all you Alfred users out there: Alfred offers some Eject commands too. I use them often.

More info from Alfred Help here.

1 Like

This sounds great.

I’m currently using a self-made xbar script to manage ejecting (which I do every couple of days when I’m taking my laptop out and about) but I’m open minded that there is a better solution.

When I have a disk that won’t eject, I relaunch the Finder, and it is gone! I suspect the problem is not that the disk was not ejected, but that the Finder did not register the fact.

1 Like

Agreed.

I don’t think the problem is a mistaken error message. Finder is calling the underlying system’s APIs to unmount and eject a volume. But that API call is failing, which usually is because some process somewhere has an open file on the device (there are other possible problems, but this is the most common).

I suspect that Finder itself (or something Finder-related like the Dock or Launchpad) has an open file on the device, which is why it can’t be ejected. When you restart the Finder, these processes end, which auto-closes their file handles, allowing the eject to succeed.

When it happens, there is no message saying the disk could not be ejected; it’s just that its icon remains on the Desktop. And after relaunching Finder, it is gone without any further attempt to eject required.

1 Like

I’ve been happily using Mountain for years. I have it installed on my M1 Macs running Monterey or later (but NOT Sequoia), as well as on older Macs running High Sierra or Mojave (or earlier!). I’d recommend getting it from the source rather than from the App Store.

Mountain, from Appgineers

2 Likes

I’ve been using Mountain for a long time as well. Unfortunately it’s been abandoned for a while too, and it’s starting to show on Sequoia, where a couple of things no longer work. But it’s still fairly useful, for example the notifications of when a volume is mounted and unmounted and a disk is ejected are handy. It also makes marking a volume to not automount easy, instead of having to edit /etc/fstab (for which there’s a long thread here on TidBITS).

One of the most interesting things about Jettison to me is that it’s kind of the eject half of Mountain. If they’d add some of the other features, it would make a great Mountain replacement that I’d buy immediately.

Indeed I’ve mentioned the technique previously. Trouble ejecting external drives - #9 by gingerbeardman

Some people (eg. Howard of The Eclectic Light Company) don’t believe it, and refuse to even try it. But it does work.

1 Like

That [relaunching the Finder] has worked for me as well. It doesn’t work every time, and I think it works less in Sequoia, but it’s definitely something I still try.

Jon Gotow’s Default Folder has added years to my life: not just in the way of convenience but as a sheer time saver.

I’m off to St Clair for Jettison!

Thank you Adam for this article, very helpful!

6 Likes

In such cases, does Disk Utility confirm the volume was unmounted?
If so, restarting Finder appears to be the trivial and perfectly correct solution.

Another reason to not install Sequoia, for me.

I owned Mountain for several years but found it to be increasingly fiddly and didn’t always work smoothly with recognizing all my external drives when it came time to re-mounting them. And app development has been glacial: the current v.1.6.6 came out last fall, and 1.6.1 came out in 2015.

I picked up Jettison in January and it has made a solid replacement that works better.

This problem has actually been around for decades, so I wouldn’t hold off on upgrading just for this.

Mountain not working quite right would only be a minor reason to not upgrade. I have no reason to put Sequoia on anything. I’m only using Sonoma because it’s required for a couple of image editing apps I want to try out.

1 Like