How to Fix Disk Not Ejected Properly Notifications After Sleep on MacBook Air 15″ M2: Senior Engineer macOS Guide
⚡ Quick 60-Second Verdict: What This Issue Means
Your MacBook Air 15″ M2 is aggressively cutting power to USB-C ports during sleep to preserve battery, causing connected drives to disconnect before macOS can unmount them cleanly. This is a power management assertion conflict—not a hardware defect—and is resolved by adjusting Energy Saver settings, disabling “Put hard disks to sleep when possible,” and ensuring your hub or drive firmware supports proper sleep/wake handshakes.
- Never yank a drive while the “Disk Not Ejected Properly” notification is visible—the drive may still be flushing write caches; forced removal corrupts APFS containers and can brick the drive’s controller.
- Do not use cheap passive USB-C splitters or non-PD hubs—they lack the power negotiation circuitry the M2’s USB4/Thunderbolt 3 controller requires for stable sleep/wake transitions.
- Avoid disabling SIP (System Integrity Protection) to “fix” IOKit assertions—this exposes the kernel to unsigned kexts that can destabilize the storage stack permanently.
- Never cover the MacBook Air’s hinge vent area while drives are attached—thermal throttling triggers emergency USB power cuts that mimic this exact symptom.
1. Immediate Safe Actions (Non-Destructive User Triage)
Three straightforward, non-destructive initial triage steps tailored specifically to USB mass storage disconnects on sleep for MacBook Air 15″ M2:
Disable “Put Hard Disks to Sleep When Possible”
This macOS setting spins down all attached storage—including USB SSDs—during idle, but the M2’s power controller often fails to spin them back up before the filesystem unmounts. Disable it globally:
- Open System Settings → Energy Saver (Sonoma) or System Settings → Battery → Options (Sequoia).
- Uncheck “Put hard disks to sleep when possible”.
- On Sequoia, also disable “Optimize video streaming while on battery”—it triggers aggressive USB power gating.
- Restart the Mac. Test by putting it to sleep (Apple menu → Sleep) with the drive attached, then wake after 30 seconds.
Why this works: The M2’s AppleSMC firmware treats USB mass storage as “internal” for power assertions. Disabling this checkbox removes the IOPMrootDomain sleep assertion that cuts VBUS on the USB-C PHY.
Prevent USB Accessory Power Cut on Sleep
macOS Sonoma/Sequoia defaults to cutting accessory power after 10 minutes of sleep. Override this via Terminal to keep VBUS live on both USB-C ports:
# Run once—persists across reboots
sudo pmset -a tcpkeepalive 1
sudo pmset -a proximitywake 0
sudo pmset -a powernap 0
sudo pmset -a standbydelayhigh 86400
sudo pmset -a standbydelaylow 86400
Then verify with pmset -g custom—ensure tcpkeepalive = 1 and proximitywake = 0. This keeps the USB-C controller in D0 (active) state during sleep, maintaining drive enumeration.
Note: Battery impact is ~1–2% per 8-hour sleep—negligible for most users. Re-enable powernap if you rely on iCloud sync during sleep.
Eject Drives Automatically Before Sleep with a LaunchAgent
Create a lightweight user LaunchAgent that runs diskutil ejectAll on sleep notification. This is safer than third-party apps and survives OS updates.
- Create
~/Library/LaunchAgents/com.user.ejectonsleep.plistwith this content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.ejectonsleep</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>diskutil list external physical | awk '/^\/dev\/disk[0-9]+/ {print $1}' | xargs -I {} diskutil eject {}</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>WatchPaths</key>
<array>
<string>/var/run/sleepd.state</string>
</array>
</dict>
</plist>
- Load it:
launchctl load ~/Library/LaunchAgents/com.user.ejectonsleep.plist - Test:
launchctl start com.user.ejectonsleep— drives should eject cleanly.
This hooks into sleepd state changes, ejecting only external physical disks before the USB controller powers down.

2. Software False Alarm Recovery & Reset Protocol
MacBook Air 15″ M2 Hardware Reset Sequence
Clears volatile USB-C controller registers (AppleSPM/IOUSBHost) and restarts the usbd daemon without a full reboot. Perform exactly in this order:
- Disconnect all USB-C devices (power, drives, hubs).
- Press and hold Control (⌃) + Option (⌥) + Shift (⇧) on the left side of the keyboard.
- While holding all three, press and hold the Touch ID / Power button for 10 seconds.
- Release all keys simultaneously. Wait 5 seconds.
- Press Touch ID once to power on.
- Immediately reconnect your drive/hub. Open Console.app → filter “USB” → verify enumeration logs show
IOUSBHostDeviceattach withoutkIOUSBTransactionTimeouterrors.
This sequence triggers the M2’s SMC Cold Reset path, flushing the USB4 retimer’s link-training state and resetting the AppleEmbeddedOSSupportHost power domain. Do not confuse this with NVRAM reset (Option-Command-P-R)—that does not touch USB PHY registers.
3. Advanced Diagnostics & Component Triage
Hardware Telemetry & Sensor Verification
Use built-in tools to confirm the root cause is power management—not a flaky cable, port, or drive controller.
- Console.app Deep Dive: Open Console → select your Mac in the sidebar → search
IOUSBHost+power. Look for:
AppleUSBHostPort::setPowerState: port 0, new state 2 (suspended)immediately followed bydiskarbitrationd: failed to unmount. This confirms the port suspends before the unmount completes. - System Information → USB: With the drive attached, hold Option and click Apple menu → System Information → USB. Verify:
• Current Available (mA): 900 (USB 3.0) or 1500/3000 (USB-C PD)
• Current Required (mA): matches drive spec
• Sleep Current (mA): should be 0 for bus-powered drives—if it shows a value, the drive requests stay-alive current. - Log Show Command (copy/paste):
log show --predicate 'subsystem == "com.apple.iokit.IOUSBHostFamily" AND eventMessage CONTAINS "suspend"' --last 1h --style compactCount suspend/resume cycles per sleep cycle. >2 cycles = hub/drive firmware handshake failure.
- Physical Inspection: Under 10× magnification, check both USB-C ports for:
• Bent VBUS pins (A4, A9, B4, B9)
• Carbon tracking between CC1/CC2 and GND
• Debris in the receptacle—use only 99% IPA and anti-static brush.

4. Diagnostic & Operating Parameter Matrix
| Diagnostic Indicator / Check | Expected Normal State | Fault Alert Threshold | Verified Resolution Target |
|---|---|---|---|
| USB Port VBUS Voltage (Sleep) | 0 V (port off) or 5 V / 9 V / 15 V / 20 V (PD negotiated stay-alive) | Voltage drops mid-negotiation (oscilloscope: <4.5 V on 5 V rail) | Stable PD contract maintained through S0ix → S0 transition; no VBUS glitch >50 ms |
pmset -g assertions PreventUserIdleSystemSleep |
0 (no assertion) when no drive activity | >= 1 held by coreaudiod, backupd, or diskarbitrationd during sleep entry |
0 assertions at sleep entry; drive unmount completes before IOPMrootDomain suspends USB |
| Drive SMART Attribute 0xC0 (Power Cycle Count) | Increments only on full power loss | Increments on every sleep/wake = drive losing VBUS unexpectedly | No increment across 10 consecutive sleep/wake cycles with drive attached |
Console: diskarbitrationd Unmount Latency |
< 500 ms from sleep trigger to “disk unmounted” | > 2 s or timeout (30 s) → “Disk Not Ejected Properly” | Consistently < 500 ms across 20 sleep/wake cycles |
| USB-C CC Line Negotiation (PD Analyzer) | Explicit Contract: 5 V / 3 A or 9 V / 3 A acknowledged | Soft Reset or Hard Reset packets during sleep entry | Zero PD resets during S0 → S0ix → S0 transition |
Kernel Log: IOUSBHostInterface::scheduleCallback Errors |
0 errors per 24 h | > 3 errors/hour = endpoint stall not cleared on resume | 0 errors for 72 h continuous sleep/wake stress test |
5. Frequently Asked Questions (FAQ)
Why does this only happen on my MacBook Air 15″ M2, not my older Intel Mac?
The M2 integrates the USB4/Thunderbolt 3 controller directly into the SoC, sharing power domains with the CPU/GPU. Apple’s ApplePMGR driver aggressively gates these domains during sleep (S0ix) to hit <2 W idle. Intel Macs used a separate Alpine Ridge/Titan Ridge controller with its own firmware that maintained VBUS independently. The M2's architecture is more efficient but less tolerant of drives that don't implement USB Attach/Detach during S0ix correctly.
My drive works fine on a powered hub—why bother fixing the direct connection?
A powered hub with its own PD controller masks the issue by keeping VBUS alive, but you lose Thunderbolt 3 bandwidth (40 Gbps → 10 Gbps on most hubs) and add a failure point. The fix above restores native 40 Gbps direct-attached performance and eliminates the hub’s power supply as a travel item. It’s also the only way to boot from an external SSD reliably on Apple Silicon.
Will disabling “Put hard disks to sleep” kill my SSD’s lifespan?
No. Modern NVMe SSDs (Samsung 980/990, WD SN850X, etc.) are rated for 1.5M+ power-on hours. The “sleep” in that checkbox refers to spindown—which NVMe drives don’t do. They enter L1.2 substate (sub-mW) automatically via ASPM. The checkbox only harms mechanical drives. For USB NVMe enclosures, the real wear is from unclean power cuts (what you’re fixing), not staying powered.
I updated to macOS Sequoia 15.1 and the issue returned. What changed?
Sequoia 15.1 tightened IOPMrootDomain assertions for Continuity Camera and AirDrop—both now request USB stay-alive during sleep. This conflicts with mass storage unmount ordering. Run the pmset commands in Step 02 again (they reset on major OS updates) and add this to your LaunchAgent plist ProgramArguments array before the eject line:
/usr/bin/pmset -a tcpkeepalive 1; /usr/bin/pmset -a proximitywake 0
This re-asserts your power profile at every sleep transition, overriding the new Continuity defaults.
Share your OS version, device model, and exact error code in our independent peer Q&A rooms.
Comments