Fix macOS Disk Ejection Issues | Generated by AI
Quick Solutions
1. Using Activity Monitor (GUI)
- Open Activity Monitor (Applications > Utilities)
- Click the Disk tab
- Look for processes using your external drive
- Select the process and click the stop button (⊘)
- Then try ejecting again
2. Using Terminal (Command Line)
Find what’s using the disk:
# Replace DISKNAME with your actual disk name (e.g., MyDrive, Untitled, etc.)
lsof | grep DISKNAME
# Or use this to see all open files on mounted volumes
lsof +D /Volumes
Identify the disk mount point:
# List all mounted volumes and their paths
mount | grep -E "Volumes|media"
# Or use diskutil
diskutil list
Find processes accessing your drive:
# Replace /Volumes/DISKNAME with your actual path
lsof | grep "/Volumes/DISKNAME"
# Shows process name and PID (Process ID)
Kill the process:
# Replace PID with the actual process ID (e.g., 1234)
kill -9 PID
# Or kill by name (less precise, affects all instances)
killall -9 processname
Step-by-Step Instructions
Method 1: Activity Monitor (Easiest)
- Open Spotlight Search (⌘ + Space)
- Type “Activity Monitor” and press Enter
- In the window that opens, click the Disk tab
- Look for your disk name in the list (right side shows “I/O Read Bytes” and “I/O Write Bytes”)
- Identify which process is accessing it
- Click the process → Click the Stop button (red circle with ⊘)
- Confirm the force quit
- Try ejecting your disk again
Method 2: Terminal (More Control)
-
Open Terminal (Applications > Utilities)
- Find your disk’s mount point:
diskutil listLook for your external drive’s name. Note the mount point (e.g.,
/Volumes/MyDrive) - Find processes using that disk:
lsof | grep "/Volumes/MyDrive"Replace “MyDrive” with your actual disk name
- Check the output - You’ll see:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Finder 123 user cwd DIR 1,2 4096 1234 /Volumes/MyDrive- COMMAND: Process name
- PID: Process ID (the number you’ll need to kill)
- Kill the process:
kill -9 123Replace 123 with the actual PID
- Try ejecting again from Finder or via Terminal:
diskutil eject /Volumes/MyDrive
Common Processes That Lock Disks
| Process | Cause | Solution |
|---|---|---|
Finder |
Browsing the disk | Close Finder windows for that disk |
Spotlight |
Indexing the drive | Disable Spotlight for external drives (System Settings > Siri & Spotlight) |
Backup or Time Machine |
Automatic backup running | Wait for backup to complete or disable |
Google Drive, Dropbox, OneDrive |
Cloud sync in progress | Quit the app or wait for sync to complete |
Terminal |
Current working directory on disk | Change directory: cd ~ then try eject |
Preview, Word, Excel |
File is open | Close the application |
Advanced: Safe Eject via Terminal
# First, find the disk identifier (shows as /dev/diskX)
diskutil list
# Eject using the identifier (preferred method)
diskutil eject /dev/disk2
# Or eject by mount point
diskutil eject /Volumes/MyDrive
# Force eject (last resort, unmounts immediately)
diskutil secureEject /Volumes/MyDrive
Prevention Tips
- Add external drives to Spotlight exclusion:
- System Settings > Siri & Spotlight
- Click “Exclude” next to your external drive
- Use proper eject method:
- Don’t just unplug—always eject first
- Right-click disk in Finder → Eject
- Close applications before ejecting:
- Save and close any files open from the drive
- Quit cloud sync apps before ejecting
- Avoid background operations:
- Don’t start backups or syncs right before ejecting
- Wait for Spotlight indexing to finish (if re-enabling)
If Nothing Works
# List all mounted volumes
mount
# Force unmount (use with caution - data loss risk if writes pending)
sudo umount -f /Volumes/MyDrive
# Or use diskutil
sudo diskutil unmountDisk force /Volumes/MyDrive
⚠️ Warning: Using sudo and force unmount should be a last resort as it can cause data loss if files are being written.