Media is write protected

Problem

You can see the error message "Media is write protected" on the screen when you try to do either of the following:

  1. During image creation, this error might occur in the image repository machine.
  2. During image deployment, this error might occur in the deployment machine.

Cause

  1. This error occurs when a hard disk is connected to a computer that is write-protected or the hard disk is in read-only mode.
  2. This error can also occur due to viruses, hardware damage, and registry issues.

Resolution

  1. Disable the write-protected setting of the hard disk by following the steps given below in the machine where the error has occurred,
    1. Select Start -> click Run.
    2. Type regedit and click OK to open the registry editor.
    3. Go to the key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies.
    4. If the StorageDevicePolicies does not exist, create it manually by right-clicking on the control key and selecting New -> Key.
    5. In the right window, double-click on WriteProtect, and set the value to 0. If WriteProtect does not exist, then right-click on the new StorageDevicePolicies key and select New –> Dword, specify the name as WriteProtect, double click the WriteProtect and set the value to 0.
    6. If it is an external hard disk, disconnect the hard disk and reconnect it. If it is an internal hard disk, restart the machine.
  2. To disable the Read-only settings of the hard disk, follow the steps given below,
    1. Select Start then right-click the command prompt and select run as administrator.
    2. Type diskpart and press Enter. Diskpart prompt will open.
    3. Type list disk and press Enter. (For volume use list volume)
    4. Type select disk DISK_NUMBER and press enter.
    5. Note: Specify the DISK_NUMBER of the disk that you want to remove read-only settings/write protection. For example Select disk 1. (For volume use select volume)

    6. If the disk that you have selected is Offline, then type online disk and press Enter else skip this step.
    7. Type attributes disk clear readonly and press Enter. (For volume use attributes volume clear readonly)
       
  3. Ensure that the hard disk is updated
  4. Scan the hard disk using an antivirus application to check if any virus exists.

Keywords: Media is write protected, read only permissions, virus