Diskpart utility utility throws error "The media is write protected" when executing a clean override on a clean drive

John Doe 40 Reputation points
2026-06-04T13:18:19.2866667+00:00

I’m trying to repurpose an old system drive. I loaded up an elevated command window, ran diskpart, selected the correct target disk index, and ran the clean command string to wipe all partitions. The command immediately aborts with a message stating the target storage layout media is write protected. There are no physical switches on an internal SSD drive. How do I clear this metadata?

Windows for business | Windows 365 Enterprise
0 comments No comments

Answer accepted by question author
Tracy Le 12,325 Reputation points Independent Advisor
2026-06-04T14:07:11.4+00:00

Hi John Doe,

To clear this logical lock you should remain in your elevated command window, ensure your target disk is still active by running select disk X where X is your drive index and then execute the command attributes disk clear readonly to strip away the write protection flag.

Once that command successfully clears the metadata block, you can safely proceed to run your clean command string to wipe out all old system partitions without further validation errors. However, if the clean command still aborts after clearing the attributes, the internal SSD controller itself might have reached its write endurance limit and entered a permanent, hardware-enforced failsafe read-only mode to safeguard existing data, which would require a manufacturer diagnostic tool to verify health status.

Hope this answer has brought you some useful information. If it did, please hit “accept answer”. Should you have any questions, feel free to leave a comment.

Tracy Le.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.