macOS 'A Disk Error Occurred' When Emptying Trash: Fix Stuck Files

Stuck files in Trash often trigger this error. Most times it's a permissions hiccup or a file still in use. I'll show you the fastest fixes, in order of what actually works.

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)

  1. Open Finder and go to your Trash (click the Trash icon in the Dock).
  2. Find the problem file. Right-click it and select Get Info.
  3. Look for the Locked checkbox. If it's checked, uncheck it.
  4. 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.

  1. Open Terminal (Finder → Applications → Utilities → Terminal).
  2. Type this command and press Enter:
    sudo chflags -R nouchg ~/.Trash/
    You'll be asked for your admin password. You won't see anything as you type – that's normal.
  3. 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

  1. Think about what the file is. If it's a movie, quit QuickTime. If it's a document, quit the word processor.
  2. 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.

Warning: This permanently deletes the file. There's no second chance. Make sure you really want it gone.

Step 1: Identify the exact file path

  1. Open Terminal.
  2. Type
    ls -la ~/.Trash/
    and press Enter. This lists everything in your Trash, including hidden files.
  3. 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

CauseFixTime
Locked file or permissionsUnlock via Get Info, then run sudo chflags -R nouchg ~/.Trash/2 minutes
File in use by an appQuit the app or eject the mounted DMG1 minute
Stubborn file that ignores FinderUse rm -f or sudo rm -rf in Terminal3 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.

Related Errors in macOS Errors
Error 50 macOS Error 50: The Finder Copy Fix That Actually Works The application can't be opened macOS 'The application can't be opened' error fix macOS Errors Showing in Google Search – Quick Fix Fix com.apple.launchd.peruser Error Crash Loop on macOS

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.