3

Sometimes Windows marks its system reserved partition as protected, meaning you cannot delete it directly from Windows disk management; you have to use diskpart delete override command. I use disk management often to delete and create partition on some disks. I am always afraid I will accidentally choose one of my working disks and delete a vital partition on it. Can a partition be protected from accidental deletion? That is, when I right click on that partition in disk management, there should be no option to delete it (or the option should be grayed out, unavailable). Windows obviously is able to do this to its partitions, how can I do this for mine ?

1 Answer 1

1

In short, you can use the following in DiskPart to protect a partition from deletion via the GUI, however, this attribute flag is only meant to be used on Recovery partitions.

  • The only partitions on Windows that are not able to be removed via the GUI are recovery [WinRE], boot, and system [OS] partitions.
  • This only prevents the partition from being deleted via the GUI, not via DiskPart

  1. WinKey + R: DiskPart
  2. lis vol
  3. sel vol
    • Select the volume [partition] you want
  4. Assign the Recovery attribute:
    • MBR: set id=27
    • GPT: gpt attributes=0x8000000000000001 || set gpt attributes=0x8000000000000001
      • It may require you to also change the partition ID to that of Recovery:
        set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"

Further information can be obtained in DiskPart via help attribute vol and help setid

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .