{"id":2318,"date":"2017-04-28T07:43:22","date_gmt":"2017-04-28T07:43:22","guid":{"rendered":"http:\/\/www.eassos.com\/blog\/?p=2318"},"modified":"2021-05-14T08:57:23","modified_gmt":"2021-05-14T08:57:23","slug":"how-to-fix-diskpart-failed-to-clear-disk-attributes","status":"publish","type":"post","link":"https:\/\/www.eassos.com\/blog\/how-to-fix-diskpart-failed-to-clear-disk-attributes\/","title":{"rendered":"How to fix &#8211; diskpart failed to clear disk attributes"},"content":{"rendered":"<p>This post covers step-by-step instructions to fix diskpart failed to clear disk attributes issue that happens during running diskpart to clear read only disk attributes.<\/p>\n<h1><span style=\"color: #0000ff;\">Symptom when diskpart failed to clear disk attributes<\/span><\/h1>\n<p>DiskPart is a text-mode command interpreter provided by Windows operating system. With this tool, you are able to complete many tasks by typing corresponding command in Command Prompt, for example, partition hard drive, create volume, format disk, clear disk attributes, etc. It is a quite handy tool, and yet it is not recommended to be used by beginner users. That\u2019s because improper operations may lead to serious issue, such as data loss.<\/p>\n<p>Sometimes DiskPart cannot work as expected, especially when the storage media contains errors. In that case, DiskPart will encounter various errors such as <a href=\"https:\/\/www.eassos.com\/how-to\/fix-diskpart-has-encountered-an-error.php\">DiskPart has encountered an error<\/a>, diskpart failed to clear disk attributes, etc. Let\u2019s see a real world case together:<\/p>\n<p>\u201c<em>I have a 500GB WD hard drive which was bought for my desktop five years ago. It is crashed and uninitialized. I can see it in Disk Management as an unallocated and uninitialized HDD. I couldn\u2019t create new volume on it in Disk Management or using DISKPART. Someone told me the media is write protected. Thus I tried to move read only by attribute disk clear readonly command but ended up with error \u2018diskpart failed to clear disk attributes\u2019. Does anybody know how to fix it?<\/em>\u201d<\/p>\n<h1><span style=\"color: #0000ff;\">Causes<\/span><\/h1>\n<ul>\n<li>The device causes the issue might be set as read-only, hidden or nodefaultdriveletter<\/li>\n<li>The storage media contain physical damage such as bad sectors.<\/li>\n<\/ul>\n<h1><span style=\"color: #0000ff;\">Solutions to fix\u00a0<\/span><span style=\"color: #0000ff;\">diskpart failed to clear disk attributes<\/span><\/h1>\n<h2><span style=\"color: #666699;\">Solution 1: Remove disk write-protection<\/span><\/h2>\n<ol>\n<li>Check the device for a physical lock. Some USB flash drives and memory cards have a physical lock which is used to set write-protection. Thus you should make sure the switch is placed to the unlocked side.<\/li>\n<li>Check whether the drive is running of out space. If there is no more free space on the drive and you try to save data on it, you are likely to get write protection error.<\/li>\n<li>Check file\u2019s attributes. Right-click the file or folder in File Explorer and select Properties, then you can view whether the \u201cRead-only\u201d option is selected. If yes, uncheck it and click OK.<\/li>\n<li>Now you can retry DiskPart to clear disk attributes again.<\/li>\n<\/ol>\n<p>Methods to remove write protection should not be limited to what have been mentioned here, you can find more approaches from the guide: <a href=\"https:\/\/www.eassos.com\/how-to\/the-disk-is-write-protected.php\">The disk is write-protected<\/a>.<\/p>\n<h2><span style=\"color: #666699;\">Solution 2: Check and repair bad sectors<\/span><\/h2>\n<p>Bad sectors are sectors on storage devices that have been damaged and lose the ability to read or write data. Since bad sectors no longer respond to any read or write requests, diskpart command cannot complete any tasks anymore. The follow steps will introduce how to check and repair bad sectors.<\/p>\n<p><span style=\"color: #000000;\">Disclaimer<\/span>: Bad sectoring repairing damages data stored on or near bad sectors, thus you should make sure all files have been backed up before performing any repairing actions; not all bad sectors can be repaired by this software, such as physical bad sectors. If your drive is badly damaged, you should send it to an experienced repair center.<\/p>\n<p>Step 1: Install and run DiskGenius (old name PartitionGuru) Free edition\u00a0from your computer. Locate the disk in question in DiskGenius (old name PartitionGuru), then click &#8220;Tools&#8221; and select \u201cVerify Or Repair Bad Sectors\u201d .<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.diskgenius.com\/manual\/img\/check-repair-bad-sectors-01.png\" alt=\"diskpart failed to clear disk attributes\" width=\"496\" height=\"405\" \/><\/p>\n<p>Step 2: Now you can see the bad sector verifying windows where you should click \u201cStart Verify\u201d button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.diskgenius.com\/manual\/img\/check-repair-bad-sectors-02.png\" alt=\"diskpart failed to clear disk attributes\" width=\"590\" height=\"584\" \/><\/p>\n<p>Step 3: DiskGenius (old name PartitionGuru) is checking bad sectors for select disk and marks bad sectors using red block.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.diskgenius.com\/manual\/img\/check-repair-bad-sectors-03.png\" alt=\"diskpart failed to clear disk attributes\" width=\"590\" height=\"584\" \/><\/p>\n<p>If any bad sectors are found, you can click \u201cRepair\u201d button to try repairing them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post covers step-by-step instructions to fix diskpart failed to clear disk attributes issue that happens during running diskpart to clear read only disk attributes. Symptom when diskpart failed to clear disk attributes DiskPart is a text-mode command interpreter provided &hellip; <a href=\"https:\/\/www.eassos.com\/blog\/how-to-fix-diskpart-failed-to-clear-disk-attributes\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"gallery","meta":{"footnotes":""},"categories":[34],"tags":[601,600,602],"class_list":["post-2318","post","type-post","status-publish","format-gallery","hentry","category-pg","tag-attributes-disk-clear-readonly","tag-diskpart-failed-to-clear-disk-attributes","tag-media-is-write-protected","post_format-post-format-gallery"],"_links":{"self":[{"href":"https:\/\/www.eassos.com\/blog\/wp-json\/wp\/v2\/posts\/2318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.eassos.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.eassos.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.eassos.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.eassos.com\/blog\/wp-json\/wp\/v2\/comments?post=2318"}],"version-history":[{"count":6,"href":"https:\/\/www.eassos.com\/blog\/wp-json\/wp\/v2\/posts\/2318\/revisions"}],"predecessor-version":[{"id":4958,"href":"https:\/\/www.eassos.com\/blog\/wp-json\/wp\/v2\/posts\/2318\/revisions\/4958"}],"wp:attachment":[{"href":"https:\/\/www.eassos.com\/blog\/wp-json\/wp\/v2\/media?parent=2318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.eassos.com\/blog\/wp-json\/wp\/v2\/categories?post=2318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.eassos.com\/blog\/wp-json\/wp\/v2\/tags?post=2318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}