This is a small tool I made to automatically eject your external drives when your Mac goes to sleep, and remount them when it wakes up.
It’s a fix for the annoying “Disk Not Ejected Properly” warnings that pop up even when nothing’s wrong. Since Apple hasn’t addressed this, I decided to make a simple, free workaround.
What this version adds:
• Now compatible with both Apple Silicon and Intel Macs
• Encrypted APFS drive support (passwords stored securely in Keychain)
• Fixed a bug where encrypted drives sometimes failed to remount after sleep, showing:
Error unlocking APFS Volume: The given APFS Volume is not locked (-69589) Unlocking any cryptographic user on APFS Volume diskX
• Added fallback mounting to make sure encrypted drives always appear in Finder
• Non-encrypted drives now reliably remount as well
• Improved permission prompts and script formatting
Important:
• You might still see the “Disk Not Ejected Properly” popup sometimes.
This is a cosmetic bug in macOS, your drives were safely ejected.
• You can verify everything worked by running:
cat ~/sleepwatcher.log
How to use:
- Download the .dmg file below.
- Open EjectDrive Setup and follow the prompts.
- Allow Terminal and SleepWatcher Full Disk Access when prompted.
- Enable SleepWatcher in System Settings → Login Items → Allow in Background.
- That’s it, your drives will auto-eject on sleep and remount on wake.
If you want to remove it later, just run Uninstall Auto-Eject.
I made this as a free alternative to apps that charge money for something this simple.
Enjoy!
--TacticalAgent