Thursday, February 4, 2010

DiskPart - Removing ReadOnly Flag from Volume

This is the process I use to add Replay/Clone of SAN disk for recovery. This is only works if the SAN allows writing to your Replay/Clone.

  1. Right click on computer and goto Disk Management
  2. Right Click on Disk Management and Rescan Disks
  3. Right click on the Disk and goto propertiesimage
  4. Find Disk by LUN and Target IDimage
  5. Right Click on the volume and Change Drive Letter and Paths
  6. Click and assign drive letter
  7. Open Command line (CMD)
  8. type 'diskpart'
  9. type 'list vol'
  10. find your volume by drive letter
  11. image
  12. type 'select vol #' (replace # with Volume number)
  13. type 'attrib vol clear readonly' (Allows disk to)
  14. image
  15. Go back to disk management and right click on the volume and Change Drive Letter and Paths
  16. Click Remove on the drive letter and Click OK
  17. right click on the volume and Change Drive Letter and Paths
  18. Click Add and add your drive letter again
  19. Disk should be have write access

 

image

Error: The operation did not complete

Answer: Most likely ISCSI mappings or Disk must be removed and added again.

2 comments:

Anonymous said...

DISKPART> select vol 1

Volume 1 is the selected volume.

DISKPART> attrib vol clear readonly

DiskPart has encountered an error: The media is write protected.
See the System Event Log for more information.


so it doesnt work...

Patrick Nielsen said...

The SAN I was working if only marked the volume as read only. You might want to check your disk level attributes.

diskpart
select disk X
attrib disk

You should see some results like below (my test disk was boot disk)

Current Read-only State : No
Read-only : No
Boot Disk : Yes
Pagefile Disk : Yes
Hibernation File Disk : No
Crashdump Disk : Yes
Clustered Disk : No

if your disk is set to ready only use the similar command for volume on your disk.

attrib disk clear readonly

I hope this helps