Sometimes, while trying to copy files to the pen drive, you may get the error message that says, “The disk is write-protected.” When a USB drive is write-protected, it restricts users from making any changes to the files and folders. Although we can format the drive to remove any write-protection settings, some computers don’t let us format the flash drive itself.
Now, let us see how to remove write protection on a USB without further delay. Here is a list of things you can try to disable the write protection on a USB.
How to Remove Write Protection on USB?
Here are a few simple ways you can remove the Write Protection on USB drives.
USB With a Lock Switch
Most SD cards and USB drives have physical switches to lock themselves. These switches are usually located on one of the sides of the drive. You might also notice “Lock” written on the front side of the SD card.
When locked, users cannot write anything on the drive. This switch also prevents users from accidentally removing any data inside the USB drive. To disable this feature, we can simply disable the switch physically.
If you do not have a physical switch, we can move on to other fixes.
Format the Drive
Formatting the removable drive will erase everything permanently and set all the settings to default. The write-protection settings will also return to the default state. Since we are about to delete all data, make sure you backup all your necessary files and folders inside the drive before starting the format process.
When you try to format, the error message might pop up that says, “You do not have sufficient rights to perform this operation.” This means that the user does not have enough privileges to format this drive. Scroll down to Solutions for Windows to fix this issue.
- Insert the USB drive.
- Right-click on the external drive you want to format.
- Click Format. Another dialog box will open.
- Under File System, choose either FAT32 (File Allocation Table 32) or NTFS (New Technology File System).
- Then, under Allocation size units, choose Default allocation size.
- Under Format Options, check or uncheck Quick Format. Quick Format does not erase the data, and we can recover deleted files. Meanwhile, unchecking Quick Format will erase everything and usually takes a few minutes.
- Click on Start.
- For MacOS, when you insert the USB drive, it will be displayed on the desktop.
- Now, click on the search icon in the top right corner.
- Search for “Disk Utility” without the quotation mark and click on Disk Utilities.
- From the list displayed on the left side, select your USB drive.
- Click on Erase at the top.
- Now, type a name for the drive select Format as MS-DOS (FAT).
- Then click on Erase.
- After the process is complete, click on Done.
- Click on Apps and go to Files. You can also press the Alt + Shift + M keys on the keyboard.
- Right-click on the drive you want to format and select Format Device.
- Click OK and wait for the process to complete.
How to Remove Write Protection on USB on Windows?
We have listed a few of Windows specific fixes that you can try to remove the write-protection.
Disable Deny Write Access
The Local group policy feature in Windows Pro and Enterprise Edition has access to many features, including removable disk access. Using the Local Group Policy Editor, an admin can modify access features for multiple users and computers throughout a network environment.
Unfortunately, the Local Group Policy Editor will not be available on Windows Home Edition. However, we can get the Policy Editor by running a Group Editor batch file which will enable the Group Policy.
Follow these steps to Enable Group Policy on Home edition.
Note: you do not need to follow these steps if you are using Professional or Enterprise version.
- Download the batch file.
- If your web browser gives you some warning, ignore them. As batch (.bat) file are system files, the browser will warn that this type of file may harm the OS itself.
- Double-click on the file you just downloaded and let the command run.
- Once everything is complete, your computer can access the Local Group Policy Editor.
How to Disable Deny Write Access?
Follow these steps to disable Deny Write Access feature.
- Press the Windows + R key to open Run
- Type “gpedit.msc” without the punctuation mark and press Enter.
- Local Group Policy Editor dialog box will open. Here, on the left side, Under Computer Configuration, click on Administrative Template > Removable Storage Access.
- Double-click on Removable Disk: Deny Write Access on the right section of the dialog box.
- Another dialog box named Removable Disks: Deny write access will open.
- Ensure that the check box is either set to Not Configured or Disabled.
- Once you make the changes, click on Apply, then OK.
Using Diskpart Command
The Diskpart manages all the storage that the computer detects. We can use this command to manage partitions of all storage devices connected to the computer. It can also manage write protection settings, create, delete or merge partitions.
Follow these steps to disable write protection using Diskpart.
- Press the Windows + R key.
- Type “cmd” without the quotation mark and press Ctrl + Shift + Enter to run Command Prompt as administrator.
- Now, type “diskpart” and press Enter.
- To list out all the storage devices connected to the computer, type “list disk” and press enter.
- You will see all the storage named Disk 0, Disk 1, Disk 2, and so on, along with their details.
- Here, locate your removable drive from the Size columns. Your USB drive’s size must match one of the disks from the list.
- Type “select disk X” where X is the disk number of the removable disk.
- Type “attributes disk clear readonly” without the quotation mark and press Enter.
- Wait for the command to remove the write protection. When the process is complete, type “exit” and press Enter.
- Restart your computer to save the changes.
Try copying some files onto the USB. Continue with the next step if this solution does not work for you.
Edit the Registry Configuration
The Registry Editor allows users to change database values stored in Windows. As the write protection values are also stored in the Registry, we can manipulate these values to remove the write protection.
However, wrong changes in the Registry may damage the OS itself. Although changing the following values will not affect your computer, read every step very carefully before making any changes.
Before we start, it is recommended to backup the Registry settings if we make any wrong changes.
- Insert the removable drive into your computer.
- Press the Windows key + R and type “regedit“
- Now, navigate to the following location from the left panel of the Registry Editor.
- Double-click on StorageDevicePolicies. There should be an item on the list named “WriteProtect” on the right panel.
- Double-click on “WriteProtect” and set Value Data to “0.“
- Click OK to save the changes.
- Restart your computer to apply those changes.
If the StorageDevicePolicies is missing, we need to add this folder and “WriteProtect” along with its value. Follow these steps if StorageDevicePolicies are missing.
- Right-click on Control (from
Computer\SYSTEM\CurrentControlSet\Controlin Registry Editor)
- Click on New > Key.
- Rename the created folder as “StorageDevicePolicies“.
- Now, right-click “StorageDevicePolicies” and click on New > DWORD (32–bit) Value.
- Name the entry as “WriteProtect“.
- Double-click WriteProtect and set the Value Data to “0“.
- Click OK to save the changes.
- Restart your computer to apply changes.
After we restart the computer, all write access.
Turn off Bitlocker
Bitlocker in Windows encrypts your data so that unauthorized users cannot access them. If the USB drive is encrypted with BitLocker, we need a password to access these data or turn off the feature. If a removable drive is encrypted with BitLocker, it is indicated by a lock icon.
Although we cannot access the drive unless we have a password, we can format the drive to remove this feature. However, formatting the drive will permanently delete every file and folder inside it.
Please follow these steps to Turn off BitLocker.
- Insert the USB Drive and right-click the removable drive from File Explorer.
- If you are using Windows 11, click on Show more options. If you are using Windows 10, ignore this step and continue to step 3.
- Click on Manage Bitlocker.
- Under your Removable data drives, click on Turn off Bitlocker.
- Another dialog box will open. Here, click on Turn off BitLocker.
It may take a few minutes, depending on the size of the USB drive.
How to Remove Write Protection on USB on MacOS?
Here are a few fixes we can try to remove write protection in macOS.
Repair Disk Permission
Permission setting in the MacOS can sometimes stop you from copying a file onto the USB drive. For MacOS, although formatting the USB drive is a viable option, you can use the Disk Utility feature to reset the permission on your removable disk.
Follow these steps to repair Permission settings.
- Insert the USB Device.
- Click on the search icon and search for “disk utility” without the quotation mark on the top-right corner.
- Click on the first search result named Disk Utilities.
- Select the removable drive you want to repair and click on the First–aid tab.
- Click on Repair Disk Permissions.
In the latest version of MacOS, Apple has removed the Disk Utility feature to Repair Disk Permission. However, we can use the Terminal. Follow these steps to Repair Disks Permission.
- Click on File located on the top left side of the desktop.
- On the Finders window, click on Applications.
- Scroll down and open the Utilities folder.
- Open Terminal.app.
- Now, type the following command.
diskutil resetUserPermissions / `id -u`
The above command will reset any read or write permission on all your storage devices
If the above command does not work, try running the following command.
sudo diskutil resetUserPermissions / `id -u`
The “sudo” command will run any command with superuser privileges and it stands for Super Do.
Restart your computer to save changes.
If both commands do not work, we can also use the repairVolume command to fix any issue. Follow these steps to repair your removable drive.
First, we need to know the disk number (example: disk2l1) that the computer has assigned to your removable drive. For this, type “diskutil list”. Now, according to the size, find your removable drive.
If you cannot find the disk number, type diskutil info “USB’s name” |grep Node (Replace USB’s name with the name of your removable drive). Now, note the node given by this command. Example /dev/disk2l1 .
Once you know the disk number, type the following command.
sudo diskutil verifyVolume /dev/disk2l1
sudo diskutil repairVolume /dev/disk2l1
When typing the above command replace the /dev/disk2l1 with the output from the previous command.
How to Disable/Enable Write Protection on a File?
If you cannot modify content inside a file, then maybe your file is on read-only mode. To enable/disable write protection or read-only mode on a file, we need to change the attribute’s value of a file. Follow these steps to change the attributes of a file.
- Right-click on the file that you want to enable/disable write protect.
- Click on Properties.
- On Attributes, check or uncheck Read–only depending on what you want to do. If you’re going to hide a file, you can check Hidden as well.
How to Add Write Protection To a USB Drive?
To add Write Protection to a USB Drive, follow this process.
- USB physical switch.
- Using diskpart command.
- Changing certain registry values Registry Editor.
- Enable Deny Write Access from Group Policy Editor.