Cause #1: File Permissions or Locked Files
The most common trigger is a file with restrictive permissions or a locked flag. You'll usually see this after you download a file, then move it to Trash, and try to empty it. The system tries to delete it, hits a permissions wall, and throws the vague 'a disk error occurred' message.
Here's the fix that works most of the time:
Step 1: Unlock the file (if it's locked)
- Open Finder and go to your Trash (click the Trash icon in the Dock).
- Find the problem file. Right-click it and select Get Info.
- Look for the Locked checkbox. If it's checked, uncheck it.
- Close the Info window.
Step 2: Repair permissions on the Trash folder
Sometimes the Trash folder itself gets wonky permissions. This is more common on external drives, but it happens on internal drives too, especially after a failed eject or a crash.
- Open Terminal (Finder → Applications → Utilities → Terminal).
- Type this command and press Enter:
You'll be asked for your admin password. You won't see anything as you type – that's normal.sudo chflags -R nouchg ~/.Trash/ - After it runs, try emptying Trash again. Right-click the Trash icon → Empty Trash.
What to expect: If the command ran without an error message, it cleared the locked flags. If the file was the culprit, Trash will empty just fine now.
Cause #2: The File Is Still in Use by an App
macOS won't delete a file that an app has open, even if you've already moved it to Trash. Common culprits: a video file open in QuickTime, a document in Word, or – the classic – a DMG that you mounted but haven't ejected.
You'll often see this error when you've had a file open for a while, then you try to empty Trash while that app is still running. The fix is to close the app or eject the disk.
Step 1: Quit the app using the file
- Think about what the file is. If it's a movie, quit QuickTime. If it's a document, quit the word processor.
- Also check for background apps like Dropbox, Google Drive, or any sync client that might be holding the file.
Step 2: Eject any mounted disk images
If the file came from a DMG, eject the disk image. Click the Eject icon next to the disk in Finder (or use Cmd+E).
Step 3: Try Trash again
Once you've quit the app and ejected disks, right-click Trash → Empty Trash. If it still fails, move to Cause #3 below.
Cause #3: Stubborn Files That Need a Terminal Force-Delete
When the first two fixes don't work – and honestly, sometimes they just don't – you need to bypass Finder and delete the file from the command line. This is the nuclear option, but it's safe if you're careful about which file you target.
Step 1: Identify the exact file path
- Open Terminal.
- Type
and press Enter. This lists everything in your Trash, including hidden files.ls -la ~/.Trash/ - Look for the problem file. Note the exact name, including spaces and special characters. If the name is My Report v2 (final).pdf, you'll need to escape the spaces and parentheses in the command.
Step 2: Delete the file directly
Use rm with the file's full path. For names with spaces, surround the path in quotes:
rm -f "$HOME/.Trash/My Report v2 (final).pdf"If the file is still stubborn, add -rf (for folders) or use the recursive flag:
rm -rf "$HOME/.Trash/stuck folder"If you get a 'Permission denied' error, prepend sudo:
sudo rm -rf "$HOME/.Trash/stuck folder"You'll be asked for your password. Again, nothing shows as you type – press Enter and wait.
What to expect: If the command succeeds, you'll see no output at all. That's a good thing. If you get an error, the file might have a special flag that the -f flag overrides, so try the sudo version.
Step 3: Clean up the empty space (optional)
After deleting, some users see the trash icon still showing a full bin. Close and reopen Finder – press Cmd+Option+Esc, select Finder, and hit Relaunch. That usually refreshes the icon.
Quick-Reference Summary
| Cause | Fix | Time |
|---|---|---|
| Locked file or permissions | Unlock via Get Info, then run sudo chflags -R nouchg ~/.Trash/ | 2 minutes |
| File in use by an app | Quit the app or eject the mounted DMG | 1 minute |
| Stubborn file that ignores Finder | Use rm -f or sudo rm -rf in Terminal | 3 minutes |
Most of the time, the first fix solves it. If you're on an external drive and none of these work, you might have a failing drive – check with Disk Utility (First Aid) before you spend hours fighting a dead disk.