Saturday, July 16, 2022

Let's not trash a microSD card before we try this!

I came across a corrupted microSD the first time and therefore thought of documenting the story for me to remember later and sharing the problem along with the fix, in case it serves you in some way. If you have found a microSD card, that behaves like a healthy one but does not show all the disk space it was supposed to have, this article might help you. The good thing was that the 16 GB microSD card (shown in picture# 1) was detected but was only showing 256 MB as the full capacity. 


Picture# 1: The 16 GB microSD card, I had trouble with

First I tried formatting the card, which did not help. I have also tried to enable any hidden files so that I could delete them. I could not see any hidden files or folders which could have explained why the card was showing only a tiny piece of its entire capacity.

As I was getting frustrated and increasingly tempted to buy a new one for my RPi Zero W, found the recommendation in the webpages mentioned under references. All of those talk about using the DISKPART utility that comes with Windows. Details about the DISKPART utility and the commands could be found in the link below:



Picture# 2: The commands to use the DISKPART utility to restore a microSD to its full capacity

To launch the DISKPART command interpreter, I launched the "Command Prompt", typed: diskpart and hit Enter button. A message popped up asking if I wanted to allow the app to make changes to my device. Clicked on yes to launch the DISKPART interpreter window. Next, I followed the five steps in the sequence that are shown in picture# 2, and, voila!! it worked! My microSD was restored to its full capacity of 16 GB! It saved money for me! 

References: