A โ€‹โ€‹write-protected SD card on an Android smartphone is one of the most annoying problems that users face. You are trying to save a photo, transfer a file or install an application, but the system displays an error: "The disk is write protected", "SD card is read-only" or "Failed to mount the memory card". The reasons can be either software (failure in Android settings, virus) or hardware (failure of the Lock switch on the card itself).

In this article we will look all possible ways to unlock from basic (checking the physical switch) to advanced (working with ADB and changing access rights via root). You will also learn how to distinguish logical blocking (which can be removed using software) from physical malfunction (requires repair or replacement of the card). If after reading there are still questions, at the end of the article there are FAQ with answers to typical cases.

1. Checking the physical Lock switch on the SD card

The most common, but often overlooked reason is the mechanical one on the side of the card. All standard-size cards have it (except for some ultra-compact models). If the switch is moved to position lock switch on the side of the card. Everyone has it microSD And SD-standard size cards (except for some ultra-compact models). If the switch is moved to position ยซLockยป, Android recognizes the card as read-only.

What to do:

  • ๐Ÿ” Remove the card from a smartphone (having previously been mounted in the settings).
  • ๐Ÿ–๏ธ Find a small slider on the side edge - usually it is labeled LOCK.
  • ๐Ÿ”„ Move it to opposite position (up if it was at the bottom, and vice versa).
  • ๐Ÿ“ฑ Insert the card back and check if the error disappears.

โš ๏ธ Attention: If the switch is broken or jammed, the card will always be detected as blocked. In this case, only replacing the card or software formatting (see section 4) will help.

๐Ÿ“Š Have you encountered an SD card being blocked?
Yes, due to physical switch
Yes, for another reason
No, but I know about the problem
What is an SD card?

2. Checking the card on another device

Before sinning on your smartphone, make sure that the problem is in the card and not in Android device. Connect the SD card to:

  • ๐Ÿ’ป Computer via a card reader (check if it is recognized as a removable disk).
  • ๐Ÿ“ท Photo or video camera (if you have one at hand).
  • ๐Ÿ“ฑ Another smartphone/tablet on Android.

If the card works fine on other devices, the problem lies in in the settings of your Android or memory card slot. If the error repeats everywhere, the card physically damaged or is blocked at the file system level.

๐Ÿ’ก

If the card is not detected on any device, try gently wiping contacts with an eraser (without pressing!) - sometimes oxidation interferes with reading.

3. Removing write protection through Android settings

Android may block writing to the SD card due to a failure in the storage settings or a conflict of access rights. To fix this:

  1. Open Settings โ†’ Storage (or Memory).
  2. Find the section "SD card" or "External storage".
  3. Tap on the three dots (โ‹ฎ) in the upper corner and select Storage settings.
  4. Check item "Format as internal memory" or "Data transfer". If it is active, disable it.
  5. Reboot the device.

On some firmware (for example, MIUI on Xiaomi or ColorOS on Oppo) you may need to reset access rights:

  1. Go to Settings โ†’ Applications โ†’ Application permissions โ†’ Storage permissions.
  2. Find an application that cannot write data to the card (for example, Gallery or File manager).
  3. Reset the permissions and grant access again.
Why does Android block writing to the SD card?

This is a security measure to prevent damage to the file system when removing the card without unmounting it. Also, blocking can work if the card is formatted in NTFS or exFAT, and Android only supports FAT32 for external drives.

4. Formatting an SD card (with data loss!)

If the previous methods did not help, you will have to resort to formatting. This will delete all data on the card, but often solves locking problems. Important: before formatting, try saving important files to your computer - even if the card is defined as "read-only", some apps (for example PhotoRec or TestDisk) can restore data.

Format methods:

  • ๐Ÿ“ฑ Via Android:
    1. Open Settings โ†’ Storage โ†’ SD card.
    2. Tap Format (or Clear).
    3. Select file system FAT32 (if there is a choice).
  • ๐Ÿ’ป Via Windows:
    1. Connect the card to the PC via a card reader.
    2. Open This computer, right-click on the SD card โ†’ Format.
    3. Select FAT32 and click Start.
  • ๐Ÿง Via Linux/macOS:

    Use the command

    sudo mkfs.vfat -F32 /dev/sdX
    (replace sdX with the current card ID).

  • File system Android support Max. file size Recommendation
    FAT32 Yes 4 GB Optimal for Android
    exFAT Partially (starting from Android 6.0) 16 EB Suitable for large files
    NTFS No (read only) 16 EB Not recommended
    ๐Ÿ’ก

    Format in FAT32 is the most reliable way to restore the functionality of an SD card on Android, but remember: the maximum size of a single file on this system is 4 GB.

    5. Unlocking via ADB (for advanced users)

    If Android stubbornly does not allow you to format the card through the interface, you can use Android Debug Bridge (ADB). This method requires enabled mode USB debugging and installed drivers ADB on the computer.

    Step-by-step guide:

    1. Enable USB debugging in the developer settings (Settings โ†’ About phone โ†’ Build number (tap 7 times) โ†’ For developers โ†’ USB debugging).
    2. Connect your smartphone to the PC and confirm permission to debug.
    3. Open the command line (Windows) or terminal (Linux/macOS) and enter:
      adb shell
      

      sm list-disks

      Remember the card ID (for example, disk:179,64).

    4. Run the command to unlock:
      sm partition disk:179,64 private

      (replace 179,64 with your ID).

    5. Reboot the device.

    โš ๏ธ Attention: Incorrect use ADB may result k data loss or firmware damage. If you are not sure, skip this method.

    โ˜‘๏ธ Preparing to work with ADB

    Done: 0 / 4

    6. Checking for viruses and resetting access rights

    Sometimes the SD card is blocked due to virusesthat change file attributes or create hidden folders with read-only rights. Also, the problem may occur after connecting the card to an infected computer.

    How to check and clean:

    • ๐Ÿ›ก๏ธ Antivirus scan:

      Install Malwarebytes or Dr.Web Light and scan the card.

    • ๐Ÿ” Manual attribute check (Windows):
      1. Connect the card to the PC.
      2. Open Command line as administrator.
      3. Enter:
        attrib -R -A -S -H X:\. /S /D

        (where X is the drive letter of the SD card).

  • ๐Ÿ“ฑ Reset permissions on Android:

    Use File Manager+ or FX File Explorer with rights rootto manually change folder permissions to 755 (for folders) and 644 (for files).

  • If a virus has damaged the file system, it can help low-level formatting through utilities like HDD Low Level Format Tool (but this is an extreme case!).

    7. Hardware faults and when itโ€™s time to change the card

    If none of the methods worked, most likely the problem is in physical malfunction the card. Signs:

    • ๐Ÿ”ฅ The card heats up when connected.
    • ๐Ÿšซ Not detected on any device.
    • ๐Ÿ”„ Mounted/unmounted cyclically.
    • ๐Ÿ“‰ The reading/writing speed has dropped significantly.

    In such cases:

    • ๐Ÿ› ๏ธ Try to restore the data via Recuva or R-Studio (if the card is still somehow readable).
    • โ™ป๏ธ Recycle the card โ€”further use may lead to the loss of all data.
    • ๐Ÿ†• Buy a new one (we recommend brands SanDisk, Samsung, Kingston with speed class A2 for Android).
    • โš ๏ธ Attention: Cheap memory cards without a brand are often counterfeited, indicating an inflated capacity. Check the actual capacity using the utility H2testw (Windows) or F3 (Linux/macOS) immediately after purchase.

      FAQ: Frequently asked questions about unlocking SD cards

      Is it possible to unlock an SD card without losing data?

      Yes, if the blocking is software (for example, due to a virus or rights failure). Try:

      1. Check the physical switch Lock.
      2. Scan the card with an antivirus.
      3. Reset access rights via ADB or file manager with root.

      If the card is defined as โ€œread-onlyโ€ on all devices, the data is most likely lost.

      Why is the card blocked again after formatting?

      This is a sign hardware wear. Possible reasons:

      • The resource of write cycles has expired (especially important for cheap cards).
      • The card controller is damaged.
      • The card slot in the smartphone is faulty (try another map).

      Solution: replace the card with a new one.

      How to unlock an SD card if the smartphone does not see it?

      If Android does not recognize the card at all:

      1. Try connecting it to the PC via a card reader.
      2. If the card is detected on the PC, format it in FAT32.
      3. If it is not detected, check the contacts on the card and in the smartphone slot (possibly oxidation).
      4. As a last resort, use utilities like DiskPart (Windows) for forced cleaning:
        diskpart
        

        list disk

        select disk X (where X is your card number)

        clean

        create partition primary

        format fs=fat32 quick

      Do โ€œmagicโ€ commands for unlocking via CMD work?

      On the Internet it is often recommended to use the command:

      diskpart
      

      attributes disk clear readonly

      This command will not work for SD cards, as it is intended for hard drives. For memory cards you need to use attrib (see section 6) or formatting.

      Can I unlock the card using a magnet?

      โŒ No! This is a myth. The magnetic field does not affect flash memory (unlike old hard drives). But you risk:

      • Damage the card contacts.
      • Damage the controller chip.
      • Lose the warranty (if the card is new).

      The only โ€œmagnetโ€ that This will help degausser for credit cards, but it is also useless for SD cards.