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
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
- WinKey + R:
DiskPart
lis vol
sel vol
- Select the volume [partition] you want
- Assign the Recovery attribute:
Further information can be obtained in DiskPart
via help attribute vol
and help setid