Why Erase Flash Drive Failing on Mac? Fixes
In this article
If your Mac fails to erase a flash drive, the most common causes are a locked drive, a corrupted partition map, or the drive being mounted read-only. The quickest fix is to unlock the drive (slide the physical lock switch if present), then use Disk Utility's Erase function with the correct format (exFAT for cross-platform, APFS for Mac-only). If that fails, you may need to erase the drive from Terminal using the `diskutil` command. Below is a step-by-step guide to resolve the issue.
What You'll Need
- Your Mac (any recent macOS version)
- The flash drive that is failing to erase
- A USB port or adapter (if using USB-C, you may need a USB-C to USB-A adapter)
- Optional: a second computer or a different USB port to test the drive
Step-by-Step
- Check the physical lock switch. Many flash drives have a small sliding switch on the side. If it's in the locked position, the drive is read-only and cannot be erased. Slide it to the unlocked position and try again.
- Unmount the drive first. Open Finder, locate the flash drive in the sidebar, and click the eject icon next to it. If it won't eject, close any open files or apps that might be using it.
- Open Disk Utility. Go to Applications > Utilities > Disk Utility, or use Spotlight (Cmd+Space) and type "Disk Utility".
- Select the drive (not the volume). In Disk Utility's sidebar, you'll see the physical drive (e.g., "SanDisk Ultra") and below it the volume(s) (e.g., "Untitled"). Click the top-level entry that shows the drive's brand and capacity. If you only see volumes, click the "View" button in the toolbar and select "Show All Devices".
- Click "Erase". With the physical drive selected, click the "Erase" button in the toolbar.
- Choose the correct format. In the dialog that appears, set the format. For a drive that will be used on both Mac and Windows, choose "ExFAT". For Mac-only use, choose "APFS" (or "Mac OS Extended (Journaled)" if you need compatibility with older Macs).
- Choose a scheme. If the option is available, select "GUID Partition Map" as the scheme. This is the standard for Intel and Apple Silicon Macs.
- Click "Erase". Confirm the action. Disk Utility will attempt to erase the drive. If it succeeds, you'll see a green checkmark and the drive will be remounted with a new empty volume.
- If Disk Utility fails, try Terminal. Open Terminal (Applications > Utilities > Terminal) and type
diskutil listto see all disks. Identify your flash drive by its capacity and device identifier (e.g., /dev/disk2). Be very careful to select the correct disk—erasing the wrong one will wipe your internal drive. - Unmount the drive in Terminal. Type
diskutil unmountDisk /dev/diskX(replace X with the actual number). You may need to enter your password. - Erase the drive with diskutil. Type
diskutil eraseDisk ExFAT MyDrive GPT /dev/diskX. Replace "MyDrive" with a name you want, and replace /dev/diskX with the correct identifier. For APFS, usediskutil eraseDisk APFS MyDrive GPT /dev/diskX. - Wait for completion. The Terminal will show progress. Once done, you'll see "Finished" and the drive will be remounted.
Common Mistakes
- Selecting the volume instead of the disk. If you erase a volume, you're only erasing the partition, not the whole drive. This can leave a corrupt partition map that causes repeated failures.
- Using the wrong format. If you choose "Mac OS Extended" for a drive you'll use on Windows, it won't work. Conversely, exFAT is fine for both, but APFS is not readable by Windows.
- Forgetting to unlock the drive. A physical lock switch is the most common cause of a "Read-only file system" error.
- Not unmounting before erasing. If the drive is in use (e.g., a file is open), Disk Utility may fail. Always eject or unmount first.
- Using a hub or extension cable. Some USB hubs or long cables can cause power issues. Plug the drive directly into the Mac's USB port.
Tips
- Try a different USB port. A faulty port can cause intermittent errors. If you have multiple ports, switch.
- Restart your Mac. This clears any temporary system glitches that might interfere with disk operations.
- Check if the drive is visible in Finder. If it doesn't appear in Finder or Disk Utility, it may be physically damaged or not properly connected. Try a different computer to see if it's recognized there.
- Use "First Aid" before erasing. In Disk Utility, select the drive and click "First Aid" to repair any filesystem errors. This can sometimes make the drive erasable.
- If the drive is very old, it might be dying. Flash drives have a limited number of write cycles. If it fails repeatedly, consider replacing it.
Troubleshooting
If the steps above didn't work, here's what to try next, in order:
- Run First Aid. In Disk Utility, select the drive and click "First Aid". This repairs the filesystem and partition map. If it reports errors, run it again until it says "Operation successful".
- Erase using a different format. Sometimes a drive fails to erase with APFS but works with exFAT or MS-DOS (FAT). Try each format.
- Use the "Security Options" slider. In the Erase dialog, click "Security Options" and drag the slider to the right (most secure). This overwrites the drive with zeros, which can bypass some stubborn sectors. Note: this takes much longer.
- Check if the drive is write-protected by firmware. Some drives have a firmware write-protect that cannot be removed. Search online for your specific drive model to see if this is a known issue.
- Try on another computer. If the drive works on a Windows PC or another Mac, the issue is with your Mac's USB controller. If it fails everywhere, the drive is likely dead.
- If nothing works, the drive may be physically damaged. Do not attempt to open or repair it yourself. Dispose of it properly (many electronics stores offer recycling).
Frequently Asked Questions
Why does Disk Utility say "Erase process has failed"?
This usually means the drive's partition map is corrupted or the drive is write-protected. Try unmounting the drive first, then erase using the Terminal method described above. If that fails, the drive may be failing.
Can I erase a flash drive with a physical lock switch?
No. The lock switch physically prevents any write operations. You must slide it to the unlocked position before erasing.
What format should I choose for a USB drive to use on both Mac and Windows?
Use exFAT. It works on both macOS and Windows without any additional software. Avoid APFS and Mac OS Extended, as Windows cannot read them without third-party tools.
Why does my Mac show the drive as read-only even after unlocking?
If the lock switch is already unlocked, the drive's filesystem may be corrupted. Run First Aid in Disk Utility, or try erasing with a different format. Some drives also have a software write-protect that can be removed using the manufacturer's utility (if available).
Is it safe to use Terminal commands to erase a flash drive?
Yes, if you are careful. The risk is selecting the wrong disk identifier. Always double-check with diskutil list before running the erase command. The command will permanently delete all data on the selected disk.
What if my flash drive is not showing up in Disk Utility at all?
Try a different USB port, a different cable (if using a hub), or a different computer. If it still doesn't appear, the drive may be dead or have a broken connector. If it's under warranty, contact the manufacturer.