Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Cannot Delete Files From SD Card? Fixes That Work

· 7 min read · Home Tech

In this article
  1. Why Your SD Card Suddenly Won't Delete Files
  2. Check the Physical Lock Switch First
  3. Clear the Read-Only Attribute on Windows
  4. Run a Disk Check to Fix File System Errors
  5. Try Deleting on a Different Device
  6. Format the SD Card as a Last Resort
  7. What If the Card Is Physically Broken or Locked?
  8. Frequently Asked Questions

If your SD card refuses to delete files, the cause is almost always a physical write-protect lock, a read-only attribute, file corruption, or the card being mounted as read-only by your device. You can usually fix it by checking the lock switch, clearing the read-only attribute, or running a disk check — here is exactly how to do each.

Why Your SD Card Suddenly Won't Delete Files

SD cards are flash storage with a simple file system (usually FAT32 or exFAT). When you delete a file, the card's controller marks that space as available. If the card is write-protected, the controller refuses to make that change, so the file stays. Write protection can be triggered by the tiny physical slider on the side of the card, by a software flag in the file system, or by the card's controller detecting errors and locking itself to prevent data loss.

Another common cause is that the device you are using — a phone, camera, or card reader — has mounted the card as read-only. This happens automatically when the operating system detects file system errors or when the card's lock switch is in the locked position. Some devices also have their own write-protect settings (like Android's "Storage" permissions) that can block deletion even when the card itself is fine.

Check the Physical Lock Switch First

Most full-size SD cards have a small switch on the left edge. When it is slid down (toward the gold contacts), the card is locked and cannot be written to or deleted from. This is the most common cause of "cannot delete" and the easiest to fix.

  • Remove the SD card from the device.
  • Look at the left edge — you will see a tiny slider. If it is in the down position, slide it up.
  • Reinsert the card and try deleting the file again.

Note that microSD cards do not have a physical lock switch, so if you are using a microSD-to-SD adapter, the switch on the adapter is the one to check. If the switch is broken or loose, the card may appear locked even when it isn't. In that case, try a different adapter or insert the microSD directly into a device that supports it.

Clear the Read-Only Attribute on Windows

If the physical lock is not the issue, the card may have a read-only attribute set in its file system. This can happen after a crash, a partial format, or when a device sets the attribute to protect data. On Windows, you can clear it using the diskpart command or the file properties dialog.

  1. Insert the SD card into your computer's card reader.
  2. Open File Explorer and note the drive letter (e.g., E:).
  3. Right-click the drive and select Properties.
  4. Under the General tab, look for the Read-only checkbox. If it is checked, uncheck it and click OK.
  5. If the checkbox is grayed out or reappears, use diskpart:

Open Command Prompt as Administrator, type diskpart, then list disk, find your SD card's disk number (be careful not to pick your main hard drive), and type select disk X (replace X with the number). Then type attributes disk clear readonly and press Enter. After that, type exit.

This command removes the read-only flag at the hardware level. If it fails with an error, the card may be physically failing or permanently write-protected.

Run a Disk Check to Fix File System Errors

File system corruption can make the card appear read-only or cause errors when you try to delete. Running a disk check on Windows or macOS can repair these errors and restore normal deletion.

On Windows, open File Explorer, right-click the SD card drive, select Properties, go to the Tools tab, and click Check under Error checking. Follow the prompts to scan and repair the drive. Alternatively, open Command Prompt as Administrator and run chkdsk E: /f (replace E: with your drive letter).

On macOS, open Disk Utility, select your SD card in the sidebar, and click First Aid. This will scan and repair the file system. Note that if the card is mounted as read-only, you may need to unmount it first (click the eject icon) and then run First Aid.

If the disk check reports bad sectors or the card becomes unreadable, the card may be nearing the end of its life. Back up any important data immediately.

Try Deleting on a Different Device

Sometimes the problem is not the card but the device you are using. A phone or camera may have a software bug, a locked file, or a permission issue that prevents deletion. Trying a different device is a quick way to isolate the problem.

  • Put the SD card in a different phone, camera, or card reader and try to delete the file.
  • If it works on another device, the original device is the culprit — check its storage settings or restart it.
  • If it fails on every device, the card itself is likely write-protected or failing.

On Android, go to Settings > Storage and check if the SD card is mounted as "read-only" or "corrupted." If it shows as corrupted, you may need to format it (which will erase all data) or use a computer to repair it.

Format the SD Card as a Last Resort

If you cannot delete files and you have backed up your data, formatting the card will remove everything and reset the file system. This often fixes stubborn write-protection issues, but it will erase all files.

On Windows, right-click the drive in File Explorer and select Format. Choose the file system (FAT32 for cards 32GB and smaller, exFAT for larger cards) and click Start. On macOS, use Disk Utility, select the card, and click Erase.

If formatting fails because the card is read-only, you can try using the diskpart method: after selecting the disk, type clean, then create partition primary, then format fs=fat32 quick (or fs=exfat). This will completely wipe the card and create a new partition table. If even this fails, the card's controller has likely locked itself permanently, and the card is not worth further effort.

What If the Card Is Physically Broken or Locked?

Some SD cards have a permanent write-protect feature that cannot be removed by software. This is rare but happens on industrial or high-security cards. If you have tried all the steps above and the card still will not delete, it may be that the card is designed to be read-only, or the controller has failed.

In that case, the card is effectively dead for writing. You can still read files from it, but you cannot modify them. The only option is to replace the card. If the card is under warranty, contact the manufacturer for a replacement.

Frequently Asked Questions

Why does my SD card say "read-only" when I try to delete files?

The read-only message means the card's write-protect flag is set. This can be the physical lock switch (on full-size SD cards), a software attribute, or the card's controller locking due to errors. Check the switch first, then clear the read-only attribute using diskpart or the file properties dialog.

Can a virus cause files to be undeletable on an SD card?

Yes, some malware can set files to read-only or hide them, making them appear undeletable. Run a full antivirus scan on your computer with the SD card connected. If the virus is on the card, scanning and cleaning it may restore normal deletion. However, the most common cause is still the lock switch or file system errors.

How do I delete a file that is "in use" on my SD card?

If a file is open in a program (like a photo viewer or media player), the operating system will not let you delete it. Close all programs that might be using the file, or restart your computer, then try again. On a phone, force-stop any app that might be accessing the card.

Will formatting my SD card fix the delete problem?

Formatting will reset the file system and remove all files, which can fix corruption or software write-protection issues. However, if the physical lock switch is on, formatting will fail. Always check the lock switch first, and back up any data you want to keep before formatting.

My SD card is locked and I can't format it. What can I do?

If the card is locked and you have tried diskpart to clear the read-only attribute, and it still fails, the card's controller may be permanently locked. Try using a different card reader, as some readers can force a write. If that doesn't work, the card is likely dead and should be replaced.