macOS: diskutil: Unmount of disk2s1 failed: at least one volume could not be unmounted / The disk wasn't ejected because one or more programs may be using it
macOS can't eject a drive because a process still has files open on it.
The disk wasn't ejected because one or more programs may be using itdiskutil: Unmount of failed: at least one volume could not be unmountedVolume failed to unmountdiskutil unmount failed dissented by PIDDisk Not Ejected Properly Meaning
Find the process: lsof +D /Volumes/NAME (or "Force Eject" in the Finder dialog, which risks data loss). Close apps, Spotlight indexing (mdutil -i off) and terminals sitting in the volume. Then diskutil unmount force /Volumes/NAME or diskutil eject.
Common causes
- App or terminal using files on the volume
- Spotlight/Time Machine indexing it
- Photos/Music library on the drive
- Backup or antivirus scanning
- Stuck process after a crash
⚡ Quick fix
lsof +D /Volumes/NAMEand quit the listed appsdiskutil unmount force /Volumes/NAMEdiskutil eject /dev/diskNonce unmounted
Detailed fix by platform
macOS
diskutil listandlsof +D /Volumes/NAME
How to diagnose
- Process — lsof output?
- Index — Spotlight?
- Force — Data safe?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Finder error code -36 macOS: The Finder can't complete the operation because some data in "x" can't be read or written. (Error code -36)
- Finder error code -43 macOS: The operation can't be completed because one or more required items can't be found. (Error code -43)
- hdiutil: create failed - Resource busy macOS: hdiutil: create failed - Resource busy (or: hdiutil: couldn't eject "disk2" - Resource busy)
Most viewed in macOS
- is damaged and can’t be opened macOS: “App” is damaged and can’t be opened. You should move it to the Trash.
- Operation not permitted (macOS privacy) macOS: Operation not permitted — Terminal/app lacks Full Disk Access (TCC privacy protection)
- zsh: command not found: brew macOS: zsh: command not found: brew (Homebrew not on PATH on Apple Silicon)
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026