
As an Amazon Associate, I earn from qualifying purchases. En calidad de Afiliado de Amazon, obtengo ingresos por las compras adscritas que cumplen los requisitos aplicables. If you buy through these links, the price is the same for you and Amazon pays me a small commission that helps keep Tecnoyfoto running.
Last updated: November 8, 2026
Need to format a write-protected micro SD card on Windows 11 or Windows 10? You may have encountered the frustrating message “The disk is write-protected” when trying to delete files, copy new data, or format your memory card.
This problem can affect microSD cards used in cameras, drones, smartphones, gaming consoles, and devices such as the Raspberry PiAffiliate link. Sometimes, the solution is as simple as checking an SD card adapter. In other cases, Windows settings or an internal memory failure may be responsible.
In this guide, I’ll explain how to remove write protection from a micro SD card using DiskPart, how to format it correctly, and what to do when Windows refuses to complete the process.
Quick answer: If Windows has applied a read-only attribute to your memory card, DiskPart may be able to remove it with the attributes disk clear readonly command. If you also need to rebuild the card’s partitions, you can use clean and create a new partition. However, these commands cannot repair a physically damaged card or bypass a permanent hardware write lock.
Why Is My Micro SD Card Write-Protected?
Write protection prevents new data from being saved or existing files from being modified or deleted.
Depending on the cause, you may still be able to open and copy the files stored on the card.
Before trying to format anything, it’s important to understand why the card has become read-only.
1. The SD Card Adapter Is Locked
Many full-size SD cards and microSD-to-SD adapters have a small slider on the side marked LOCK.
When this switch is in the locked position, a compatible card reader may prevent writing to the card.
Keep in mind that microSD cards themselves don’t have a physical lock switch. The switch is found on full-size SD cards and certain adapters.
If you’re using an adapter, check the switch before attempting any software-based solution.
2. Windows Has Set a Read-Only Attribute
Windows can apply a read-only attribute to a disk, preventing certain write operations.
When this happens, the built-in DiskPart utility may allow you to clear that attribute without formatting the memory card.
The command we’ll use is:
attributes disk clear readonlyHowever, this command only changes disk attributes that Windows can manage. It cannot override a physical lock or a permanent restriction imposed by the card’s internal controller.
3. The File System Is Corrupted
Removing a memory card without safely ejecting it, losing power during a write operation, or experiencing storage errors can damage the file system.
As a result, Windows may have trouble reading the partition structure or modifying files.
File system corruption doesn’t always mean the card is write-protected, but the resulting errors can look similar.
4. The Card Reader or Adapter Is Faulty
Sometimes the memory card isn’t the problem.
A defective USB reader, an incompatible adapter, or a poor connection can cause read and write errors.
Before assuming the card is damaged, try another card reader, USB port, or computer.
5. The Micro SD Card Is Wearing Out
MicroSD cards use flash memory, which has a limited number of write cycles.
Over time, memory cells can deteriorate. Some card controllers respond to certain internal failures by permanently disabling write operations.
In these situations, you may still be able to read and copy your files, but attempts to delete, modify, or format the card will fail.
If the controller has permanently locked the card, DiskPart won’t be able to repair it.
What to Check Before Formatting a Write-Protected SD Card
Before using commands that could erase partitions, I recommend performing a few basic checks.
- Back up important files: if you can still read the card, copy everything you want to keep to your computer or another storage device.
- Check the lock switch: if you’re using a full-size SD adapter, make sure it isn’t locked.
- Try a different card reader: this helps rule out hardware and compatibility issues.
- Test another computer: determine whether the problem affects just one Windows installation.
- Check whether writing works: if your data is backed up and the card doesn’t appear physically damaged, try copying a small test file.
If the card still refuses write operations, we can use DiskPart to inspect its attributes.
How to Format a Write-Protected Micro SD Card with DiskPart
DiskPart is a command-line disk management utility built into Windows 11 and Windows 10.
It allows us to inspect storage devices, modify supported attributes, remove partitions, create new partitions, and format volumes.
There are two different operations worth understanding:
- Removing write protection: attempts to clear a read-only disk attribute without necessarily deleting files.
- Formatting the card: prepares a partition with a file system and makes existing files inaccessible through normal methods.
You don’t always need to do both.
WARNING: The following procedure includes commands that can remove partitions from the selected disk. If you select the wrong drive, you may lose access to important data. Back up your files and double-check the disk number before continuing.
Step 1: Open Command Prompt as Administrator
Connect your microSD card to your computer using a compatible card reader.
Press the Windows key, type cmd, and select Run as administrator for Command Prompt.
In the Command Prompt window, enter:
diskpartPress Enter to launch the DiskPart utility.
Step 2: Find Your Micro SD Card
Enter the following command:
list diskDiskPart will display the storage disks currently detected by Windows.
Identify your microSD card by checking its capacity and other available information.
For example, a card sold as 128 GB may appear with a capacity of approximately 119 GB because manufacturers and Windows use different units when reporting storage capacity.
If your card is listed as Disk 2, enter:
select disk 2Replace 2 with the actual disk number assigned to your memory card.
Next, inspect the selected disk:
detail diskThis displays additional information that can help you verify the selected device.
This is the most important safety check in the entire process. Don’t rely on capacity alone if multiple connected drives have similar sizes.
If you’re unsure which disk is your microSD card, stop and identify it before proceeding.
Step 3: Check the Read-Only Status
With the correct disk selected, enter:
attributes diskDiskPart will display the disk’s current attributes.
Two particularly useful fields are:
- Current Read-only State
- Read-only
These values don’t always match.
For example, the disk may report Current Read-only State: Yes while the configurable Read-only attribute is set to No.
This distinction matters because it can indicate that simply clearing the Windows attribute won’t solve the underlying problem.
Step 4: Remove the Read-Only Attribute
Now run:
attributes disk clear readonlyThis command attempts to clear the selected disk’s read-only attribute.
If DiskPart reports success, check the attributes again:
attributes diskThen test whether Windows allows you to write to the card.
If your card works normally again and you don’t need to erase it, you can stop here.
You don’t need to delete partitions or format a working card just because it was previously write-protected.
Remember that DiskPart cannot remove a physical lock or a permanent write-protection state imposed by faulty hardware.
Step 5: Remove Existing Partitions with Clean
If you want to erase the existing partition structure and prepare the card from scratch, continue with this step only after backing up your important files.
Make sure the correct disk is still selected.
Then enter:
cleanThe clean command removes the partition and volume formatting information from the selected disk.
This is especially useful when a card contains multiple partitions or a structure that Windows cannot easily manage through File Explorer.
There is an important difference between these two commands:
clean: removes the disk’s partition information.clean all: attempts to write zeros to every accessible sector, making it a much longer operation.
For this procedure, we only need clean.
Neither command is a solution for a card that remains permanently write-protected.
If DiskPart reports a write-protection or I/O error during this step, stop and investigate the cause before entering any additional commands.
Step 6: Create a New Primary Partition
After successfully removing the previous partition structure, create a new partition:
create partition primaryThis creates a primary partition using the available space on the card.
Step 7: Format the Micro SD Card
Now we need to choose an appropriate file system.
For an SDXC microSD card larger than 32 GB, when the device you plan to use supports exFAT, enter:
format fs=exfat quickexFAT supports files larger than 4 GB and is commonly used for high-capacity SD cards.
The quick option performs a quick format instead of attempting to overwrite the entire storage area.
If you’re using an SDHC card with a capacity of up to 32 GB, or you specifically need FAT32 compatibility, use:
format fs=fat32 quickDon’t automatically choose exFAT for every card. Use the file system recommended by your device manufacturer and the applicable SD card standard.
Step 8: Assign a Drive Letter
After formatting is complete, enter:
assignWindows will attempt to assign an available drive letter to the newly formatted volume.
Finally, exit DiskPart:
exitYou can also close the Command Prompt window.
If everything completed successfully, your microSD card should now be accessible through File Explorer.
To verify that it works, copy a small file to the card, safely eject it, reconnect it, and confirm that the file is still there.
This simple test helps confirm that the card can both accept and retain written data.
DiskPart Commands to Format a Write-Protected SD Card
Here’s a quick summary of the DiskPart commands used in this guide.
Important: This sequence is intended for readers who have already backed up their data and verified the correct disk. Run each command individually, replacing the placeholder disk number with the correct value.
diskpart
list disk
select disk X
detail disk
attributes disk
attributes disk clear readonly
clean
create partition primary
format fs=exfat quick
assign
exitReplace X with the number of your microSD card.
Use FAT32 instead of exFAT when required by the card standard or the device you’re using.
If you only want to remove the read-only attribute without erasing anything, stop after attributes disk clear readonly and check whether the card works.
Don’t run clean unless you’re ready to remove the existing partitions.
Other Ways to Format a Micro SD Card
DiskPart isn’t the only tool available for managing memory cards.
If you prefer a graphical interface, several alternatives are worth considering.
SD Memory Card Formatter
SD Memory Card Formatter is the official formatting utility provided by the SD Association.
It’s specifically designed for SD, SDHC, SDXC, and SDUC memory cards and follows the relevant SD file system specifications.
For routine SD card formatting, this is one of the first alternatives I recommend trying.
However, the formatter cannot guarantee that a physically damaged or permanently write-protected card will become usable again.
Windows Disk Management
Windows includes a graphical disk management tool that can display partitions, create volumes, and perform basic formatting operations.
To open it, press Windows + R and enter:
diskmgmt.mscYou can inspect connected drives and manage supported volumes without typing multiple DiskPart commands.
Just like DiskPart, Windows Disk Management cannot bypass a permanent hardware write lock.
Third-Party Partition Management Software
Programs such as AOMEI Partition Assistant, EaseUS Partition Master, and MiniTool Partition Wizard offer graphical tools for managing disks and partitions.
Some features are available in free editions, while others may require a paid license.
These programs can be convenient, but they aren’t necessarily more effective than Windows utilities when the underlying problem is physical memory failure.
Before installing additional software, I recommend checking whether the built-in Windows tools already meet your needs.
FAT32 vs. exFAT vs. NTFS: Which File System Should You Use?
Choosing the correct file system is important when formatting a memory card.
There isn’t one universal format that works best for every device.
| File System | Advantages | Limitations |
|---|---|---|
| FAT32 | Broad compatibility with many devices. Standard file system for SDHC memory cards. | Does not support individual files of 4 GB or larger. |
| exFAT | Supports large files and is the standard file system for SDXC and SDUC cards. | Some older or specialized devices may not support it. |
| NTFS | Provides advanced file management features and journaling. Useful primarily for Windows storage. | Not the standard SD card format and has limited compatibility with many cameras and other devices. |
According to the SD Association’s capacity standards:
- SD: up to 2 GB, using FAT12 or FAT16.
- SDHC: more than 2 GB and up to 32 GB, using FAT32.
- SDXC: more than 32 GB and up to 2 TB, using exFAT.
- SDUC: more than 2 TB and up to 128 TB, using exFAT.
FAT32 is not obsolete. It remains an important file system for compatibility with many storage devices.
If you’re preparing a microSD card for a camera, drone, gaming console, or another specific product, check the manufacturer’s requirements.
When the device offers its own formatting function, using that option is often the simplest way to ensure the card is prepared as expected.
What If DiskPart Cannot Remove Write Protection?
Sometimes the attributes disk clear readonly command finishes without an obvious error, but the memory card remains write-protected.
This doesn’t necessarily mean you entered the command incorrectly.
Check the following possibilities:
- Locked SD adapter: verify the position of the physical lock switch or try another adapter.
- Faulty reader: test a different USB reader or a compatible built-in card slot.
- Windows restrictions: some company-managed computers use policies that prevent writing to removable storage devices.
- Read-only volume attributes: a particular volume may have its own attributes, separate from the disk attributes.
- Card controller failure: a memory card that consistently refuses writes across multiple readers and computers may have developed an internal fault.
If the card continues to report Current Read-only State: Yes after the configurable attribute has been cleared, don’t assume repeatedly running DiskPart will solve the problem.
At that point, trying another reader or computer can provide more useful information than repeating the same commands.
Frequently Asked Questions About Write-Protected Micro SD Cards
Can I Format a Write-Protected Micro SD Card Without Losing Data?
Clearing a read-only disk attribute doesn’t normally delete your existing files.
However, formatting the card or running clean can make stored files inaccessible through normal methods.
If your goal is simply to regain write access, start by checking the lock switch and attempting to clear the read-only attribute.
If you need the files, back them up before performing any destructive operations.
Why Does DiskPart Show an I/O Device Error?
An I/O device error means Windows couldn’t successfully complete a read or write operation.
Possible causes include a faulty card reader, a damaged USB connection, an incompatible adapter, or problems with the memory card itself.
Try another reader and another computer before assuming that the card has permanently failed.
If the error consistently occurs across different setups, particularly during both read and write operations, the card may be defective.
Why Does My Raspberry Pi MicroSD Card Have Multiple Partitions?
When you install an operating system such as Raspberry PiAffiliate link OS, the card may contain multiple partitions, including Linux file systems that Windows doesn’t recognize natively.
As a result, Windows File Explorer may not display the entire card in the way you expect.
This doesn’t automatically mean the card is write-protected or damaged.
If you no longer need the operating system or its files, DiskPart can help remove the old partition structure and prepare the card for another use, provided the card is writable.
Why Does My SD Card Show as RAW in Windows?
When a partition appears as RAW, Windows generally isn’t recognizing a valid file system on that partition.
This can happen because of file system corruption, an unsupported format, or partition problems.
If the card contains important files, don’t format it immediately. Consider your data recovery options first.
If you don’t need to preserve its contents and the card still accepts writes, you can attempt to create a new partition and format it.
Does DiskPart Clean Permanently Erase Everything?
Not necessarily.
The clean command removes partition information, but it doesn’t overwrite every location where data was previously stored.
Depending on the situation, some files may still be recoverable using specialized tools.
However, you should never rely on recovery being possible after deleting partitions or formatting a drive.
Always verify the selected disk and back up important data before proceeding.
Why Isn’t Windows Detecting My Micro SD Card?
If the card doesn’t appear in DiskPart or Windows Disk Management, first check the physical connection.
Try a different USB port, card reader, or computer.
Also make sure your reader supports the card’s capacity standard.
If the card isn’t detected by any compatible device, it may have experienced a serious hardware failure.
Can a Write-Protected SD Card Be Repaired?
Sometimes, yes.
If the problem comes from a locked adapter, a configurable read-only attribute, or an issue with the partition structure, the card may become usable again.
But if its internal controller has permanently disabled writing because of hardware failure, software tools generally cannot reverse that condition.
In that case, recovering readable files and replacing the card is the safer option.
How Do I Know If My MicroSD Card Is Failing?
Warning signs include repeated write errors, files that appear to return after deletion, unsuccessful formatting attempts, and problems occurring across multiple readers and computers.
Another warning sign is a card that allows reading but consistently refuses all writing operations.
These symptoms don’t prove a particular hardware failure on their own, but they are good reasons to stop relying on the card for important data.
If the problems persist, I recommend replacing it.
Conclusion: How to Fix a Write-Protected Micro SD Card
If you need to format a write-protected micro SD card, the first step is to identify what’s causing the restriction.
Sometimes, checking the adapter or clearing a read-only attribute with DiskPart is enough to restore normal operation.
When you need to remove an old partition structure, DiskPart can also help you create a new partition and format the card using FAT32 or exFAT, depending on the device’s requirements.
However, no formatting utility can guarantee the recovery of a memory card with an internal hardware failure.
My recommendation is simple: recover your important files first, confirm that you’ve selected the correct storage device, and only use destructive formatting commands when they’re actually necessary.
And if the card continues to show persistent write errors, replacing it is usually a better decision than risking the loss of valuable files.
Continue reading
Next related guide · 6 min read
How to Change a Drive Letter in Windows 11 & 10 (The Ultimate 2026 Guide)
Last updated on February 6, 2026 Managing storage in Windows is a core skill, but sometimes the default drive letter assigned to your hard…
Continue with this article

