Removing read only flag from Windows Diskpart Partition tool

I was trying to investigate a failed disk from a RAID array using a USB hard drive dock and Windows 7. The problem was Windows was reporting that the disk was read-only, so it wouldn’t repartition the hard disk.

I opened up diskpart tool in windows (Run As Administrator) and tried to run the clean command, but again it complained that the hard drive was in read-only mode.

Finally, I found the way to remove the read-only flag, so I could wipe the drive, and scan it for bad sectors.

DISKPART> list disk
DISKPART> select disk 2
DISKPART> list part
DISKPART> select part 2
DISKPART> attrib part clear readonly

5 thoughts on “Removing read only flag from Windows Diskpart Partition tool

  1. Hello Felipe, please fix sequence of commands so anyone can follow and detonate the system table. Below is the correct sequence:
    >list volume
    >select volume n (where n = the problem volume)
    >attributes disk clear readonly
    >attributes volume clear readonly

    If anyone has followed the steps and lost table system can be bypassed using program MiniTool Partition Recovery

  2. I tried,
    attributes disk clear readonly
    error was diskpart failed to clear disk attributes

    after clean, create partition primary
    error was Disk is write protected

  3. If you select a “volume” then ask it to clear a “disk”, that may be the problem. After having the same failure trying to clear the “disk”, I had success when I entered, “attributes volume clear readonly”.

Leave a Reply

Your email address will not be published. Required fields are marked *