Home / Safety / What to do if the disk is protected from formatting. We format the flash drive, if it is write-protected - remove protection. Removing protection from overwriting a flash drive using the Windows command line

What to do if the disk is protected from formatting. We format the flash drive, if it is write-protected - remove protection. Removing protection from overwriting a flash drive using the Windows command line

Sometimes there are cases that it is impossible to format a USB flash drive or SD card, transfer or write data to them. Windows system gives an error message " The disk is write protected. Remove protection or use another disc". Many devices come with a lock lever on the flash drive itself. Make sure that the lever itself on the SD card or flash drive is set to " unlocked". Unfortunately, in some cases, devices can be physically damaged, which will lead to the purchase of a new one. If you are sure that everything is in order: the lever is unlocked, the device has not been subjected to physical shock, then we will consider ways to reanimate the drives and try to remove the protection from recording from a flash drive and SD memory cards.

How to remove write protection from an SD card, flash drive or disk

The error when the SD card, flash drive or disk is write-protected may be technical and nothing will help. But there are many cases when malware can change the settings in the registry and thereby block the formatting of the flash drive. We will also use special utilities from flash drive manufacturers that will help fix the error if it is a common software failure.

Note:If there is a physical formatting blocker, then first of all check the lever on the flash drive or SD memory card, most likely it is blocked.

1. Using the registry

Press button combination Win+R and type regedit to enter the Registry Editor.


Follow the path:

  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies

If you don't have an option StorageDevicePolicies then create a partition named StorageDevicePolicies by right clicking on the folder Control. If there is a value, then see below what parameters should be.

Go to the created StorageDevicePolicies folder, select it, and right-click on the empty field with the right mouse button and Create > DWORD value (32 bits). Give the new parameter a name WriteProtect, then double-click on it to open the properties, and assign a value 0 . Reboot your PC and check if it gives you an error that the disk is write-protected. If this method does not help, then move on.

2. Using cmd

Insert a flash drive or SD memory card into the computer's USB port and run the command prompt as an administrator.

Enter the following commands:

  • diskpart- launching the tool for working with disks.
  • list disk- shows what drives are connected to the computer. The flash drive in my case is located Disc 1 7640 MB in size.
  • select disk 1- where 1 this is the disk number shown above. Disc 1 in my case this flash drive.
  • attributes disk clear readonly- clear the attributes of the flash drive.
  • clean- clean the flash drive.
  • create partition primary- create a section.
  • format fs=fat32- format in FAT32. (You can change fat32 on the ntfs if you use a flash drive only on windows systems.)

3. Using Group Policy

Click win+r and type in the line gpedit.msc.

Follow the paths below: Computer configuration > Administrative Templates > System > Access to removable storage devices. On the right, find the items " Removable drives " and disable, by double-clicking on the desired line - write, read, execute, if enabled.

Although optical discs are still in demand, there is no need to talk about any popularity of this type of media. Today they have almost been replaced by portable flash drives or simply flash drives. These small devices are characterized by versatility, reliability and the ability to store large amounts of information for a long time. And yet, despite their reliability and resistance to physical damage, flash drives, like all devices, can eventually start to work with errors.

One of these errors, and, by the way, very common, is the spontaneous activation of write protection. It manifests itself in the fact that when you try to write or delete a file from the media, the system displays the message "The disk is write-protected." It also happens that the flash drive is not formatted Windows tools, but it usually happens in more complex situations. However, the problem is not so unsolvable, and today we will just look at the main ways to fix it.

Why does the "Disk is write-protected" error appear?

The causes of the malfunction described above may be different, but, as a rule, they are all associated with either a configuration failure Windows settings, or with the failure of the flash-memory of the device, or with damage to the file system. Hardware failures and failures in the microcontroller cannot be ruled out. It often happens that the user himself blocks the device by switching a special hardware toggle switch, but this only applies to those flash drives that are equipped with a similar mechanism.

Blocking the drive can also be caused by lack of free disk space, viruses, natural wear and tear of flash memory (the device is switched to read-only mode), incorrect formatting, removal from the USB connector during data recording, thermal and electrical effects, ingestion moisture, removing or damaging the corresponding driver, the appearance of a large number of bad sectors, less often changing the file system after using a flash drive on devices with a different operating system. So, how to remove protection from a flash drive that cannot be written to?

Removing protection from a flash drive by hardware

Some manufacturers of flash drives equip drives with a small mechanical switch that allows you to turn write protection on and off. If your device has a similar toggle switch, make sure it is set to the UnLock position (toward the open padlock icon).

Insert a flash drive into a USB port and try to write something to it. If you suspect that the switch is broken, do not disassemble the device, but rather take it to a service center.

How to remove protection using the registry editor

If write protection is not related to hardware problems, you can try to remove it through the registry. The fact is that a parameter can be set in the registry that prohibits making changes to the file system of the drive. Click on the keyboard Win+R, enter the command regedit and press enter.

Expand the following branch in the left column of the opened editor:

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/StorageDevicePolicies

Now see if there is an option in the right column of the editor WriteProtect. If it is present and its value is 1, then you have found the reason why the flash drive is write-protected. Double-click on the parameter line with the mouse and change the current value from 1 to 0. Save the settings, restart the computer and check the result.

Attention, it is likely that you will not have some element of the above path. In this case, it must be created manually. Let's say there is no StorageDevicePolicies directory. Right-click on the previous subsection and select "New" → "Section" from the menu.

Naturally, you also need to create a WriteProtect parameter. It must be of type DWORD, but can also be QWORD on 64-bit systems.


Using the command line

We figured out how to remove write protection from a flash drive through the registry, let's look at another way - using the built-in console utility diskpart. After connecting the USB flash drive to the computer, open a command prompt as administrator and run the following commands in sequence:

diskpart
list disk
select disk N(where N is the serial number of the flash drive)
attributes disk clear readonly
exit

The first command launches the Diskpart utility, the second displays a list of all disks connected to the computer.

With the third command, we select the serial number of the removable media, the fourth - remove the write protection from it. The fifth command terminates the Diskpart utility.

This tool can also be used to format a write-protected flash drive, but this is when the files on it are of no value. In this case, after the fourth step, you should run the following commands:

clean
create partition primary
format fs=ntfs


Unlock flash drive through local group policy

Another way to remove write protection involves using the Local Group Policy Editor. By pressing Win+R call the "Run" window, enter in it gpedit.msc and press enter.

In the left column of the editor, follow the path Computer Configuration → Administrative Templates → System → Removable Storage Access.

Now in the right column, find the option "Removable drives: Deny reading", double-click on it and make sure that the radio button in the settings window that opens is set to "Disabled" (the default should be "Not set").

Utilities of popular manufacturers to remove protection

In some cases, it is not possible to remove protection from a USB flash drive using the system alone. At the same time, it is often not only impossible to write anything to the media, but when formatting a USB flash drive, Windows writes that the disk is write-protected. In such situations, they can help out a lot. special utilities. It is important, however, to understand that most of these programs perform a complete formatting of the drive during the unlocking process, so about creating backup all the files on it should be taken care of in advance.

JetFlash Recovery Tool is one of the most popular flash drive recovery utilities. It is intended mainly for repairs. flash drives Transcend and A-Data, but may work with other types of media. The utility supports removing write protection, restoring from the RAW file system, formatting with preliminary data saving, and fixing file system corruption. The program can be used even in cases where the flash drive is not recognized by the system at all.

A utility for recovering flash drives based on Alcor microcontrollers. Like the previous tool, it allows you to remove write protection, as well as restore the normal operation of the device. The utility supports creating protected partitions on a disk, flashing the controller and analyzing flash memory. Unfortunately, the utility has been discontinued by the developer, however, it continues to be successfully used to “treat” Alcor drives.

And at the end of the review, we suggest getting acquainted with another utility for unlocking flash drives. This is HP USB Disk Storage Format Tool - universal free program, used primarily for formatting different models flash drives. The utility supports unlocking USB devices, selecting a file system when formatting, assigning labels, applying data compression for NTFS. You can also use it to create bootable MS-DOS flash media.

Question from user

Hello. I'm trying to write to a flash drive word document With hard drive, but an error appears that the disk is write-protected. This has never happened before, I didn’t hit the flash drive, I didn’t drop it, I didn’t do anything with it ...

Interestingly, I tried to delete some file from the flash drive - exactly the same error appeared, there was no access. Those. in fact, I can only copy previously recorded data from a USB flash drive. Can you tell me how to remove this error?

PS Windows 7, 8 GB Kingston USB stick (most common)

Hello.

Such an error can be caused by several reasons: a hardware malfunction of the flash drive (for example, if you accidentally dropped it before), a virus infection, a "manual" write protection setting, etc.

In this article, I will consider in sequence all the popular causes (causing this error) and how to fix them. I think that by presenting the article in a similar format, it will be easier and easier for you and other users with the same error to solve the problem.

Typical error when deleting a folder from an SD card // example

Reasons blocking writing to a flash drive

Eliminate consistently!

1) Check if there is a write lock on the hardware level

Experienced users probably remember that earlier on floppy disks there was a small lever, thanks to which it was possible to protect the information on it from unwanted removal(or changes). And in my opinion, the thing was extremely useful!

Now on most USB flash drives there is no such protection, one part of the manufacturers (mainly Chinese) produces such flash drives. Therefore, some users do not attach much importance to some "locks" on the body of the flash drive. Meanwhile, if protection is enabled, then you will not write anything to such a flash drive (see photo below).

Well, SD cards (used in cameras, for example) have a small switch on the side. If you move it to the Lock position (blocked), then the flash drive becomes read-only.

The moral of the last sentences: first of all, check if there is a mechanical write protection, if the lever is set correctly (and in general, if it is on your device).

2) Is the flash drive (computer) infected with a virus?

I remember my student days... When it was necessary to bring and connect a USB flash drive quite often to computers "infected" with viruses (moreover, consciously and knowing it in advance) - otherwise it was problematic (or even impossible) to print materials. After such a connection, I had to check the flash drive for viruses and clean the "infection".

If you do not have an antivirus on your computer, I recommend choosing one from the list:

3) Is there a place on the flash drive?

I understand that this question is somewhat banal, but still. If the size of the recorded file is larger than the remaining free space on the flash drive, you can get a recording error.

To find out how much free space is left on the flash drive: open "My Computer", then right-click on the flash drive, and open it properties. In the tab general- will indicate how much space is occupied, and how much is free.

4) Is it worth it to write protection in the registry

First you need to open the registry editor as an administrator. You can do this, for example, through the task manager: to launch it, press the key combination Ctrl+Shift+Esc(or Ctrl+Alt+Del ).

Next click file/new task and in line open enter the command regedit(note that the task will be run as an administrator).

By the way, you may find the article on how to open the registry editor helpful.-

(for Windows XP branch: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\USBSTOR )

Important! If branches StorageDevicePolicies will not be in the registry - it means you do not have a record lock in the registry. Just in case, you can create a branch (a branch in the registry is an analogue of a folder in Explorer) and then the Write Protect string parameter with the value "0". Creating branches and options is like working in a regular explorer, it's like creating a simple folder.

5) Check the file system of the flash drive for errors

A similar error can also pop up due to errors in the file system of the flash drive. For example, in the process of copying a file, you removed the USB flash drive from the USB port or simply turned off the light - errors could well appear on it (by the way, file system may be marked as RAW in such cases).

To check the flash drive for errors, open "My computer", then open properties flash drives, and in the section service press the button (checking the disk for errors, see screenshot below).

6) Is there a read-only attribute on the flash drive?

Another reason why Windows may give an error when writing a file to a USB flash drive is read-only attribute (if it is installed on a flash drive). There is nothing wrong with this attribute, it only tells the system that this disk is read-only, so it does not write data to it.

By the way, this happens quite often if you have picked up some types of viruses, or, for example, downloaded something from torrents (the uTorrent program often creates files with a read-only attribute).

And so, we will remove this attribute.


7) Check if there is any protection in the group policy editor

Writing to a flash drive can be disabled through the Group Policy Editor. Therefore, I also recommend checking if there is a treasured parameter there ...

Note: Windows Starter and Home users will not be able to open the Group Policy Editor.

To open the Group Policy Editor:

  1. press button combination Win+R;
  2. enter the command gpedit.msc;
  3. click Enter .

It should have the "Removable drives: disable recording" option. Open it up and see if it's enabled...

By default, the parameter should be set to "Not set" (see screenshot below). If not, switch it to this position, save the settings and restart your computer.

Parameter responsible for prohibiting recording

8) Formatting a flash drive

Perhaps this is the last thing that can be done if all other advice turned out to be in vain and did not lead to anything. Formatting the media helps in many cases, including our error discussed in this article.

Note: copy all the necessary data from the flash drive, when formatting from the flash drive, everything will be deleted (just in case, I warn you ☺)!

In most cases, to format a flash drive, just go to "My computer", select a flash drive among the disks, right-click on it and in context menu choose a team "Format" .

If it is not possible to format the media: errors will come out, the computer will freeze, etc., then you need to use special utilities to format it. One of those that I would recommend is HDD LLF Low Level Format Tool.

HDD LLF Low Level Format Tool

A small utility used for low-level formatting disks, flash drives. It helps in the most difficult situations when it is not possible to format the media through Windows. Interfaces supported: S-ATA (SATA), IDE (E-IDE), SCSI, USB, Firewire.

The utility is distributed in several versions: there is also a portable one that does not need to be installed.

Because there is no Russian in the program, I will show with an example how the media is formatted.

After launching the utility, click the button "Continue for Free".

When it is over, Windows will prompt you to format the flash drive (you can format it in the usual way through "My Computer"). As a rule, after low-level formatting, the flash drive is easily and without errors formatted in Windows.

By the way, if your flash drive still does not work, I recommend trying to restore it. Here is another way described in this article:

That's all I wanted to say! For additions on the topic - I would be grateful.

A flash drive is a versatile and very convenient means of storing information. However, questions may arise when working with it. Surely, many users have encountered the fact that it is not possible to write anything to a flash drive, since it is protected. So, from this article you will learn how to format a USB flash drive if it is write-protected.

But before you take any serious action, make sure that the problem is in the write protection. It is also possible that the computer refuses to write information to the media due to damage to the USB port or the flash drive itself. In addition, there are external drives that have a special write protection switch on the case. It is also worth checking, just in case, for viruses on the carrier. If this is not the case, there are several ways to remove write protection.

One of the simplest and most commonly used methods. To work with diskpart, you do not need to download third-party programs, it is already installed on computers with an operating system. Windows system XP and later. Procedure:

  1. Open command prompt as administrator;
  2. Enter "diskpart";
  3. Enter "list disk";
  4. We are shown a list of connected media (which are displayed as Disk 0, Disk 1, etc.). With its help, we determine the number of the Disk we need. It is very important not to mix up the numbers, as you risk losing all data from other media, such as a hard drive. To eliminate the error, you need to know exactly the size of the memory on the flash drive.
  5. Enter "attributes disk clear readonly". If the operation is successful, a disk cleanup message will appear. At this stage, it is worth stopping for those who want to simply remove the write protection and not format the data right away;
  6. To completely clean the flash drive, enter "clean";
  7. Enter "create partition primary «;
  8. For formatting in FAT32, enter the command "format fs=fat32", for NTFS - "format fs=ntfs";
  9. Exit the utility using the "exit" command.

Accessing the Windows Local Group Policy Editor

To run it, simultaneously press the Win and R keys, in the window that appears, enter "gpedit.msc". Open the branch: Computer Configuration / Administrative Templates / System / Access to Removable Storage Devices. Here at the top there is an item "Removable drives: prohibit writing / reading." Place a checkmark next to "Disable". Now you can try formatting the media again. If the “Disable” parameter was already there, then it’s not about system limitations, but about the flash drive itself, and you need to try another method.

Checking the Windows Registry

Sometimes the formatting ban can be due to incorrect registry settings. To verify this, open a command prompt as an administrator and type "regedit". The Registry Editor window opens. Select the HKEY_LOCAL_MACHINE folder, from there we go down to System and then to CurrentControlSet, there we click on Services and then on USBSTOR. We will see several parameters at once, but we are only interested in Start. Its value (indicated in brackets after the code) should be 3. If there is any other number, then you need to correct it. To do this, right-click on the parameter, select the change function and type 3 in the panel that opens (the selected number system does not matter). If the registry value was initially correct, then you will have to try to remove protection from the flash drive by another method.

You can also try another way to solve the problem without leaving the registry. In the way already described above, we get to the CurrentControlSet folder, but from there we go to the Control folder. It should have a StorageDevicePolicies section. Here we are interested in the WriteProtect parameter. Its value must be 0 in hexadecimal. If the parameter is set incorrectly, we redirect it. If the value is correct initially, feel free to exit the registry and try to remove protection in a different way.

Using the diskmgmt.msc utility

This utility is already installed in the system. We call the command line and enter "diskmgmt.msc". Find the drive you want to format. We right-click on it and click on "Delete volume", and confirm. Now in the context menu we find the option "Create volume", select "primary partition". We leave all settings in it by default.

Using Apacer USB3.0 Repair Tool

This is a fairly effective and extremely simple application, which, however, will have to be downloaded from the Internet. There are only two functions in the application menu: Format (format) and Restore (restore). The first function will completely delete all data from the flash drive, and the second will return the factory settings (that is, remove the write protection).

Access to the manufacturer's website

Some major manufacturers create websites for their customers where you can get free consultation or even replacing a failed media. You can also find special formatting software on them.

The era of floppy disks has already sunk into oblivion, now people everywhere use new generation drives - flash drives. This device is compact and can hold a large amount of data. But even flash drives are far from perfect. Quite often, various problems arise when working with flash media. For example, the most common error is due to the fact that while working with a storage medium, the OS writes "The disk is write-protected." What does this mean, and how to remove write protection from a flash drive? We will talk about this in this article.

Flash drive protection can be based on hardware or software. It is for this reason that there are many ways to remove write protection. Let's talk about each in more detail.

If you do not know how to remove protection from a memory card or flash drive, then first turn your attention to the device case. Most likely the root of the problem is mechanical protection. Each microSD card and some flash drives have a special switch on the case. It is responsible for activating the write protection. I'm sure the switch in my pocket changed its position, which led to problems. Everything is fixed very simply. You just need to change the position of the switch.

In addition, it is worth checking the performance of the flash drive. To do this, try connecting it to a different port. And it’s better to test the drive on another PC, if possible. If everything is in order, then the problem lies in the software.

Software problems

If the device is working correctly and the mechanical switch is in the correct position, you need to know how to remove protection from the disk programmatically. This can be done in several ways. Let's analyze them in more detail.

Formatting NTFS

By default, the flash drive is formatted in FAT32. However, this file system has one limitation that few people know about: the maximum amount of recorded data should not exceed 4 GB. This leads to a rather ambiguous situation. On the one hand, writing is allowed, but on the other hand, due to FAT32, you cannot upload a large file to a flash drive.

To remove write protection from a flash drive, you need to format the drive and change the file system from FAT32 to NTFS. There are no restrictions regarding the amount of recorded data. Therefore, the question of how to unlock a flash drive will disappear by itself. To change the file system, you need to connect the drive to a PC and go to "Computer". Before formatting the flash drive, save its contents to your PC.

Find your device there and right-click on it. Select "Format" from the drop-down list. A new dialog will open, in which, near the inscription "File system", you need to set the NTFS option. Having done this, click on "Start". The formatting process will start, during which all data from the drive will be deleted and the file system will change to NTFS.

It is recommended to remove the flash drive from the USB connector via "safe removal". Nevertheless, when it comes to NTFS, then this is not a recommendation, but a strict rule that must be followed. Otherwise, you risk damaging your device.

Windows Registry

It's no secret that the registry is a real lifesaver for any Windows user. With the help of this section, you can solve almost any problem. Data storage blocking is no exception. How to fix this problem? To remove protection from a flash drive or microSD, you must perform the following manipulations:


Sometimes the StorageDevicePolicies section may simply not be on your PC. How can I remove protection from a flash drive in this case? Just create the StorageDevicePolicies manually. Right-click on the previous directory (in our case it is Control), then in the menu that appears, click on "Create", and then select "Partition". The system will prompt you to enter a name. We drive in StorageDevicePolicies there, after which we create a section.

Next, you need to go to the directory that appears and right-click on the menu located on the right. In the list that appears, click on "Create", and then select the option "DWORD Value". We select the bitness characteristic depending on your system (64 or 32 bits). New parameter call it WriteProtect and set it to 0. Again, restart the PC and check if the information is being written to the flash drive.

Group Policy

If the disk is protected and it was not possible to fix it through the registry, you need to check the group policy. Perhaps it is she who prohibits writing data to the media. To test the policy, you need to do the following:


Command line

Another way to remove protection if the flash drive is write-protected is to interact with the command panel. To restore the correct operation of the flash drive, we are guided by this instruction:


After carrying out all the above steps, the notification that the flash drive is write-protected should no longer bother you.

Software

Flash drive manufacturers take care of their customers by creating special utilities that can repair problematic devices. If you are faced with the fact that the flash drive is not formatted, not recorded, etc., then just use the proprietary program. It is worth noting that when choosing software to restore the functionality of a flash drive, you need to pay attention to the manufacturing company. If you use devices from Transcend, then a program called JetFlash Recovery will suit you, owners of flash drives from Silicon power should be used USB Flash Drive Recovery, etc. You can download the utility on the official website of the manufacturer.

In addition, there are a lot of third-party programs that also allow you to solve recording problems. Among such utilities, it is worth highlighting D-Soft, Flash Doctor, etc. As a rule, the process of restoring a flash drive using these programs is simple and straightforward. You need to adjust the formatting options and click on "Start". When the cleaning is completed, the protection of the flash drive will be deactivated, and you will be able to write various information to the device.

Virus

If none of the above methods helped, then malware is probably the root of the problem. software, which "settled" on your drive. There are many viruses on the World Wide Web. And some of them are able to block writing to a flash drive.

What to do if there is a virus on the drive? Get rid of it with one of the modern antiviruses. Arrange a disk check, and then delete potentially dangerous files. After that, the problem with the recording should be resolved.